Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add resource attributes lost moving ReconfigurableOpenTelemetry to opentelemetry-api-plugin #11

Merged
merged 3 commits into from
Jul 29, 2024

Conversation

cyrille-leclerc
Copy link
Contributor

@cyrille-leclerc cyrille-leclerc commented Jul 28, 2024

Add resource attributes lost moving ReconfigurableOpenTelemetry to opentelemetry-api-plugin.

Default service.name, service.namespace, service.version, service.instance.id, and jenkins.url where no longer populated if default values set by the GUI were mising (eg config as code use cases).

Fix for:

Testing done

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@cyrille-leclerc cyrille-leclerc requested a review from a team as a code owner July 28, 2024 20:57
@cyrille-leclerc cyrille-leclerc added the major-bug For changelog: Major bug. Will be highlighted on the top of the changelog label Jul 28, 2024
<opentelemetry-instrumentation.version>2.5.0</opentelemetry-instrumentation.version>
<opentelemetry-semconv.version>1.26.0-alpha</opentelemetry-semconv.version>
<opentelemetry-instrumentation.version>2.6.0</opentelemetry-instrumentation.version>
<opentelemetry-semconv.version>1.25.0-alpha</opentelemetry-semconv.version>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We revert semconv to 1.25 as opentelemetry instrumentations have a dependency on semconv 1.25.

@cyrille-leclerc
Copy link
Contributor Author

@kuisathaverat please review


@Test
public void test_instantiate_instrumented_http_client() {
ReconfigurableOpenTelemetry openTelemetry = new ReconfigurableOpenTelemetry();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be in a try-with-resources?

Suggested change
ReconfigurableOpenTelemetry openTelemetry = new ReconfigurableOpenTelemetry();
try (ReconfigurableOpenTelemetry openTelemetry = new ReconfigurableOpenTelemetry()) {

ReconfigurableOpenTelemetry openTelemetry = new ReconfigurableOpenTelemetry();
HttpClientBuilder httpClientBuilder = ApacheHttpClientTelemetry.create(openTelemetry).newHttpClientBuilder();
CloseableHttpClient httpClient = httpClientBuilder.build();
System.out.println(httpClient);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to assert something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes verify we don't have class loading issues. I'll iterate on the test

public void test_instantiate_instrumented_data_source() {
try (ReconfigurableOpenTelemetry openTelemetry = new ReconfigurableOpenTelemetry()) {
DataSource dataSource = JdbcTelemetry.create(openTelemetry).wrap(new BasicDataSource());
System.out.println(dataSource);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to assert something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto, verify class loading issues. I'll iterate on these tests

@kuisathaverat kuisathaverat added the bug For changelog: Minor bug. Will be listed after features label Jul 29, 2024
@cyrille-leclerc cyrille-leclerc merged commit 77de024 into main Jul 29, 2024
17 checks passed
@cyrille-leclerc cyrille-leclerc deleted the add-lost-resource-attributes branch July 29, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For changelog: Minor bug. Will be listed after features major-bug For changelog: Major bug. Will be highlighted on the top of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants