-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
metricCustomizers / attributesAsLabels doesn't work with string attributes #1146
Labels
Comments
@polarnik Same as with #1147, I cannot reproduce your issue. This is the output that I get: # HELP jetbrains_youtrack_Hub_HubEventsFailed hubEventsFailed jetbrains.youtrack:name=HubIntegration,type=Hub,attribute=HubEventsFailed
# TYPE jetbrains_youtrack_Hub_HubEventsFailed untyped
jetbrains_youtrack_Hub_HubEventsFailed{EventSyncStatusStatus="Active, syncing everything",HubIntegrationStatus="Active and working",PermissionCacheStatus="Hub permission management",RunningJob="None",name="HubIntegration"} 0.0
# HELP jetbrains_youtrack_Hub_HubEventsIgnored hubEventsIgnored jetbrains.youtrack:name=HubIntegration,type=Hub,attribute=HubEventsIgnored
# TYPE jetbrains_youtrack_Hub_HubEventsIgnored untyped
jetbrains_youtrack_Hub_HubEventsIgnored{EventSyncStatusStatus="Active, syncing everything",HubIntegrationStatus="Active and working",PermissionCacheStatus="Hub permission management",RunningJob="None",name="HubIntegration"} 3.0
# HELP jetbrains_youtrack_Hub_HubEventsPending hubEventsPending jetbrains.youtrack:name=HubIntegration,type=Hub,attribute=HubEventsPending
# TYPE jetbrains_youtrack_Hub_HubEventsPending untyped
jetbrains_youtrack_Hub_HubEventsPending{EventSyncStatusStatus="Active, syncing everything",HubIntegrationStatus="Active and working",PermissionCacheStatus="Hub permission management",RunningJob="None",name="HubIntegration"} 0.0
# HELP jetbrains_youtrack_Hub_HubEventsProcessed hubEventsProcessed jetbrains.youtrack:name=HubIntegration,type=Hub,attribute=HubEventsProcessed
# TYPE jetbrains_youtrack_Hub_HubEventsProcessed untyped
jetbrains_youtrack_Hub_HubEventsProcessed{EventSyncStatusStatus="Active, syncing everything",HubIntegrationStatus="Active and working",PermissionCacheStatus="Hub permission management",RunningJob="None",name="HubIntegration"} 0.0
# HELP jetbrains_youtrack_Hub_HubEventsReceived hubEventsReceived jetbrains.youtrack:name=HubIntegration,type=Hub,attribute=HubEventsReceived
# TYPE jetbrains_youtrack_Hub_HubEventsReceived untyped
jetbrains_youtrack_Hub_HubEventsReceived{EventSyncStatusStatus="Active, syncing everything",HubIntegrationStatus="Active and working",PermissionCacheStatus="Hub permission management",RunningJob="None",name="HubIntegration"} 3.0 |
Yes, it's my mistake. I used version 1.1.0 because there was a typo in my docker-compose file. I mounted a jmx agent two times, a new version and a release version 1.1.0 into a same file. I will use Multi-stage builds instead of volumes/mounts of external files FROM maven:3.9.9-eclipse-temurin-21-jammy
RUN apt-get update && apt-get install -y git
RUN git clone https://github.com/prometheus/jmx_exporter.git /tmp/jmx_exporter
WORKDIR /tmp/jmx_exporter
RUN mvn -DskipTests=true package
RUN mkdir /opt/app/
RUN cp /tmp/jmx_exporter/jmx_prometheus_javaagent/target/jmx_prometheus_javaagent-*-post.jar /opt/app/jmx_prometheus_javaagent.jar
FROM jetbrains/youtrack:2025.1.62967
ENV OTEL_JAVA_AGENT_VERSION=2.13.1
ENV JOLOKIA_JVM_AGENT_VERSION=2.2.1
ENV OTEL_JAVAAGENT_EXTENSIONS=/opt/app/opentelemetry-javaagent.jar
USER root
RUN mkdir /opt/app/
COPY --from=0 /opt/app/jmx_prometheus_javaagent.jar /opt/app/jmx_prometheus_javaagent.jar
RUN /bin/sh -c "yum -y install curl hostname"
ADD https://search.maven.org/remotecontent?filepath=org/jolokia/jolokia-agent-jvm/$JOLOKIA_JVM_AGENT_VERSION/jolokia-agent-jvm-$JOLOKIA_JVM_AGENT_VERSION-javaagent.jar /opt/app/jolokia-agent-jvm-javaagent.jar
ADD https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$OTEL_JAVA_AGENT_VERSION/opentelemetry-javaagent.jar $OTEL_JAVAAGENT_EXTENSIONS
RUN chown -R jetbrains:jetbrains /opt/app/
USER jetbrains |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
We can select an MBean with string and numeric attributes and define a config section
attributesAsLabels
for all string attributes, but jmx_prometheus_javaagent will ignore all string attributesSee also:
Environment
Config
jmx_exporter.yml
youtrack.jvmoptions
docker-compose
Steps
Actual result
The output doesn't have any new labels, it has only numeric attributes and one label 'name':
Expected result
String attributes:
- HubIntegrationStatus
- PermissionCacheStatus
- PermissionCacheStatus
- RunningJob
- EventSyncStatusStatus
will be converted to labels
The text was updated successfully, but these errors were encountered: