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

Handle spans in the Loki exporter #3166

Closed
jean opened this issue Apr 19, 2021 · 3 comments
Closed

Handle spans in the Loki exporter #3166

jean opened this issue Apr 19, 2021 · 3 comments
Labels
comp:grafanalabs Grafana Labs components - Loki, Grafana exporter/loki Loki Exporter

Comments

@jean
Copy link

jean commented Apr 19, 2021

Is your feature request related to a problem? Please describe.

  • We want to instrument code using the web SDK (PWA running on edge devices).
  • We'd like to add spans for something that we'll call e.g. "task logs".
  • We'd like to route the "task log" spans to Loki for long-term storage and display to clients (each client getting to see logs from their org, which may be coming from many devices).
  • We'd also like to route the traces including these "log" spans to analysis backends such as Datadog and/or Zipkin.

I think that sending these as spans makes sense, since we want to send the full traces to e.g. Datadog as well, for analysis. (In fact the immediate reason for sending them as spans is that the web SDK doesn't support sending logs. That's coincidental, but may also be the case for other clients as noted in e.g. #3071.)

Describe the solution you'd like

Loki is format-agnostic, although it does support various parsers. A span serialized to JSON would work just fine.

Describe alternatives you've considered

  • Implement logging in the web client. This seems like make-work. There's no real difference between logs and traces:

    [...] I don't believe tracing and logs are two separate things, [...] Ted Young, on InfoQ.

Additional context

From @gramidt on slack:

The Loki exporter also only supports "Logs" at this time and not "Traces/Spans". The effort to add this should be rather minimal for a basic implementation, but effort none the less since signal translation hasn't been added to the collector yet.

In a case like this: is signal translation actually necessary? Could the lokiexporter just accept spans and send them through to Loki, pretending that they're logs?

Transform logs to spans (PR WIP - #3003): #3071

alexperez52 referenced this issue in open-o11y/opentelemetry-collector-contrib Aug 18, 2021
* kafka exporter: seperate message conversion for otlp and jaeger

* fix test

* fix format

* Revert "fix format"

This reverts commit f02e8fbb693b8b962916ee2999612e80c1c52bc7.

* Revert "fix test"

This reverts commit 23230cc11f2f6fb3dcca094127d66916000fbc44.

* Revert "kafka exporter: seperate message conversion for otlp and jaeger"

This reverts commit 418471881ac6bc919bf59163f0f04291e8991e7b.

* convert traces/metrics/logs to sarama.ProducerMessage directly

* fix linting error (impi) and changed CHANGELOG.md

Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
@alolita alolita added the comp:grafanalabs Grafana Labs components - Loki, Grafana label Sep 30, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2022

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@github-actions github-actions bot added the Stale label Nov 4, 2022
@jpkrohling jpkrohling added exporter/loki Loki Exporter and removed Stale labels Nov 21, 2022
@jpkrohling
Copy link
Member

@jean, I believe this is beyond the scope of the Loki exporter. Translating between Traces and Logs (or the other way around) is something that should be done at a different level, perhaps using the proposed "connectors" feature (cc @djaglowski). I'm closing this issue, but feel free to reopen if you think there's something specific about Loki that I'm not considering.

cc @mar4uk

@jean
Copy link
Author

jean commented Nov 24, 2022

@jpkrohling I'm fine with closing this. The better way is probably just to enable sending logs from the web client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:grafanalabs Grafana Labs components - Loki, Grafana exporter/loki Loki Exporter
Projects
None yet
Development

No branches or pull requests

3 participants