open-telemetry / community

OpenTelemetry community content
https://opentelemetry.io
Apache License 2.0
779 stars 234 forks source link

Want to add Grafana as a exporter in Opentelemetry collector #1387

Closed sshiv5768 closed 1 year ago

sshiv5768 commented 1 year ago

Discussed in https://github.com/open-telemetry/community/discussions/1386

Originally posted by **sshiv5768** March 17, 2023 ## Goal Receive telemetry data from the simple flask app to opentelemetry collector and send it to Grafana. ## Approach - Created a demo flask app. - Getting telemetry data to Otel-Collector container - Running Grafana container - Added Grafana credentials to the ``config.yml`` ## Issues facing - There is no direct plugin for opentelemetry in grafana. - Getting below error when i run ``opentelemetry-instrument flask run`` ``` Error: failed to get config: cannot unmarshal the configuration: 1 error(s) decoding: * error decoding 'exporters': unknown type: "grafana" for id: "grafana" (valid values: [logging jaeger kafka prometheusremotewrite zipkin otlp otlphttp file opencensus prometheus]) 2023/03/17 06:46:07 collector server run finished with error: failed to get config: cannot unmarshal the configuration: 1 error(s) decoding: * error decoding 'exporters': unknown type: "grafana" for id: "grafana" (valid values: [logging jaeger kafka prometheusremotewrite zipkin otlp otlphttp file opencensus prometheus]) ```
jpkrohling commented 1 year ago

Grafana (dashboard) is only visualizing data that is stored in some backend, such as Tempo/Jaeger (traces), Loki/... (logs), or Prometheus/Graphite/... (metrics).

This means that your Collector will need to export data to a database or backend like the ones above, and you'll need to use those backends as data sources in your Grafana.

Given you specifically mentioned Grafana, here's a documentation page with more information: https://grafana.com/oss/opentelemetry/