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

JVM metrics not visible in New Relic APM due to missing service.instance.id #597

Closed
ffsetit opened this issue Feb 21, 2023 · 6 comments
Closed

Comments

@ffsetit
Copy link

ffsetit commented Feb 21, 2023

I have the OLTP plugin installed and configured to send data to New Relic which is working correctly.
However when looking at the APM data the JVM metrics are not displayed correctly with the following message displayed

The JVMs view lets you identify instances of your service that are behaving unusually and diagnose problems related to memory, garbage collection, or other internal runtime behavior. To see runtime/VM metrics broken down by instance, add the service.instance.id attribute to your OpenTelemetry metrics. To see all runtime/VM metrics, go to metrics explorer.

The raw data is present, however the service.instance.id attribute is not. I attempted to add this via the plugins advanced config as
service.instance.id=jenkins-test however upon restarting Jenkins the attribute is still not present and the startup logs contain
OpenTelemetry SDK initialized: SDK [config: otel.traces.exporter=otlp, otel.metrics.exporter=otlp, otel.exporter.otlp.endpoint=https://otlp.nr-data.net, resource: service.name=jenkins, service.namespace=jenkins, service.version=2.391]
indicating that the additional SDK parameter was not read.

Jenkins: 2.391
OLTP Plugin: 2.11.0

@pnvnd
Copy link

pnvnd commented Feb 21, 2023

@ffsetit I tested with the Jenkins OpenTelemetry Plugin 2.11.0 and Jenkins 2.375.3 and was able to see the JVM metrics in New Relic after setting the environment variable OTEL_RESOURCE_ATTRIBUTES="service.instance.id=localhost"

For reference, I did this with Docker using the following:

docker run --name jenkinsci -d -e OTEL_LOGS_EXPORTER="otlp" -e OTEL_RESOURCE_ATTRIBUTES="service.instance.id=localhost" -p 8080:8080 jenkins/jenkins:lts

image

In New Relic, it looks like this:
image

Clicking on JVM and on localhost I see these JVM metrics:
image

Let me know if this works for you.

@ffsetit
Copy link
Author

ffsetit commented Feb 22, 2023

@pnvnd i can confirm that adding Environment=OTEL_RESOURCE_ATTRIBUTES=service.instance.id=..... to the systemd override.conf file does add the attribute and jvm metrics become visible in new relic.

Is this a bug that adding the config to manage jenkins > configure system > OpenTelemetry (advanced) > configuration properties did not work?

@cyrille-leclerc
Copy link
Contributor

Thanks for the great feedback. We will fix this soon.
Note that the service.instance.id attribute is being clarified at the moment, this will make our work easier. See:

Is this a bug that adding the config to manage jenkins > configure system > OpenTelemetry (advanced) > configuration properties did not work?

Good catch. It's not supported by the code and it would be good to support it.

See:

@cyrille-leclerc
Copy link
Contributor

@cyrille-leclerc
Copy link
Contributor

Note that we are re-aligning with the OTel Java Instrumentation official JVM runtime metrics adopting the instrumentation:opentelemetry-runtime-metrics lib.

@cyrille-leclerc
Copy link
Contributor

Can you please test https://github.com/jenkinsci/opentelemetry-plugin/releases/tag/opentelemetry-2.12.0-rc1

It uses the instrumentation of the Otel Java Auto Instrumentation library to collect JVM / runtime metrics and it produces service.instance.id.

@cyrille-leclerc cyrille-leclerc added this to the 2.12.0 milestone Mar 30, 2023
@cyrille-leclerc cyrille-leclerc changed the title JVM metrics not visible in New Relic APM JVM metrics not visible in New Relic APM due to missing service.instance.id Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants