rh-messaging / artemis-prometheus-metrics-plugin

Apache License 2.0
22 stars 20 forks source link

Changing HELP output for Prometheus #33

Open svanschalkwyk opened 2 months ago

svanschalkwyk commented 2 months ago

I'm running version 2.5 on Artemis 2.34 . I'm scraping the metrics from /Metrics with an OTEL collector. The OTEL log has large number of "has this help xxxxxx, expected yyyyyy", when the OTEL is scraped by Prometheus:latest. Is there any way to replace the HELP syntax? Thank you

brusdev commented 2 months ago

@svanschalkwyk can you describe the steps to setup an env and reproduce this issue?

svanschalkwyk commented 2 months ago

localhost:8161/metrics from the plugin:

# HELP artemis_address_memory_usage_percentage Memory used by all the addresses on broker as a percentage of the global-max-size
# TYPE artemis_address_memory_usage_percentage gauge
artemis_address_memory_usage_percentage{broker="0.0.0.0",} 0.0
# HELP jvm_memory_max_bytes The maximum amount of memory in bytes that can be used for memory management
# TYPE jvm_memory_max_bytes gauge
jvm_memory_max_bytes{area="nonheap",broker="0.0.0.0",id="Compressed Class Space",} 1.073741824E9
jvm_memory_max_bytes{area="nonheap",broker="0.0.0.0",id="CodeHeap 'non-profiled nmethods'",} 1.22908672E8
jvm_memory_max_bytes{area="heap",broker="0.0.0.0",id="G1 Eden Space",} -1.0
jvm_memory_max_bytes{area="heap",broker="0.0.0.0",id="G1 Survivor Space",} -1.0
jvm_memory_max_bytes{area="nonheap",broker="0.0.0.0",id="Metaspace",} -1.0
jvm_memory_max_bytes{area="nonheap",broker="0.0.0.0",id="CodeHeap 'profiled nmethods'",} 1.22908672E8
jvm_memory_max_bytes{area="nonheap",broker="0.0.0.0",id="CodeHeap 'non-nmethods'",} 5840896.0
jvm_memory_max_bytes{area="heap",broker="0.0.0.0",id="G1 Old Gen",} 2.147483648E9
# HELP artemis_number_of_pages number of pages used by this address

OTEL exporter log output:

2024-06-24T12:59:39.024Z        error   prometheusexporter@v0.103.0/log.go:23   error gathering metrics: 16 error(s) occurred:
* collected metric jvm_memory_used_bytes label:{name:"instance"  value:"e9f5273f-6c49-4ed6-9cc8-2ea51b0a5c03"}  label:{name:"job"  value:"my_app"}  label:{name:"jvm_memory_pool_name"  value:"CodeHeap 'non-nmethods'"}  label:{name:"jvm_memory_type"  value:"non_heap"}  gauge:{value:1.55456e+06} has help "Measure of memory used." but should have "The amount of used memory"
* collected metric jvm_memory_committed_bytes label:{name:"area"  value:"nonheap"}  label:{name:"broker"  value:"0.0.0.0"}  label:{name:"id"  value:"CodeHeap 'non-nmethods'"}  label:{name:"instance"  value:"activemq-service:8161"}  label:{name:"job"  value:"activemq"}  gauge:{value:2.555904e+06} has help "The amount of memory in bytes that is committed for the Java virtual machine to use" but should have "Measure of memory committed."
* collected metric jvm_memory_used_bytes label:{name:"instance"  value:"e9f5273f-6c49-4ed6-9cc8-2ea51b0a5c03"}  label:{name:"job"  value:"my_app"}  label:{name:"jvm_memory_pool_name"  value:"CodeHeap 'non-profiled nmethods'"}  label:{name:"jvm_memory_type"  value:"non_heap"}  gauge:{value:1.1536384e+07} has help "Measure of memory used." but should have "The amount of used memory"
* collected metric jvm_memory_used_bytes label:{name:"instance"  value:"e9f5273f-6c49-4ed6-9cc8-2ea51b0a5c03"}  label:{name:"job"  value:"my_app"}  label:{name:"jvm_memory_pool_name"  value:"G1 Survivor Space"}  label:{name:"jvm_memory_type"  value:"heap"}  gauge:{value:1.441576e+06} has help "Measure of memory used." but should have "The amount of used memory"
brusdev commented 2 months ago

@svanschalkwyk what steps are you doing to setup OTEL exporter?

svanschalkwyk commented 2 months ago

docker-compose.yaml:

    image: otel/opentelemetry-collector
    container_name: otel-collector
    hostname: otel-collector
    restart: always
    command: ["--config=/etc/otel-collector-config.yaml"]
    volumes:
      - ./otel/otel-collector-config.yaml:/etc/otel-collector-config.yaml

otel-config.yaml:

  otlp:
    protocols:
      grpc: 
        endpoint: -----:4317
      http:
        endpoint: -----:4318
  prometheus:
    config:
      scrape_configs:
        - job_name: 'activemq'
          scrape_interval: 5s
          metrics_path: '/metrics'
          static_configs:
            - targets: ['activemq-service:8161']

and

service:
  extensions: [pprof, zpages, health_check]
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [debug,zipkin, otlp]
    metrics:
      receivers: [otlp,prometheus]
      processors: [batch]
      exporters: [debug,prometheus]
    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [debug]
svanschalkwyk commented 2 months ago

On broker.xml, only registering the plugin. No other settings. Using 2.50.