Trying to configure Grafana agent for collecting Java metrics using OTEL collector. The agent setup is detailed below. I am getting error like:
line 2: field http_listen_port not found in type server.config
line 7: field agent not found in type config.config
line 10: field receivers not found in type config.config
line 16: field processors not found in type config.config
line 29: field exporters not found in type config.config
line 36: field service not found in type config.config
Agent config:
server:
http_listen_port: 8200 # Port for receiving OTLP dataprometheus:
wal_directory: /tmp/agent-walagent:
collection_interval: “10s” # Adjust this interval as neededreceivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317 # IP and port where the OTLP receiver should listenprocessors:
memory_limiter:
limit_mib: 150 # Adjust as needed
check_interval: 1s
batch:
send_batch_size: 10
send_batch_max_size: 2048
timeout: 5s
resource:
attributes:
- key: host
value: example-hostexporters:
prometheusremotewrite:
endpoint: http://prometheus:9090/write # Replace with your Prometheus server’s endpoint
remote_timeout: 10s
write_retries: 10
remote_write_timeout: 30sservice:
pipelines:
metrics:
receivers: [otlp]
processors: [memory_limiter, batch, resource]
exporters: [prometheusremotewrite]
{{ATTACHED}}