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

Update Example for Loki Exporter to new OTLP standard #35770

Open
lucalamalfa91 opened this issue Oct 14, 2024 · 3 comments
Open

Update Example for Loki Exporter to new OTLP standard #35770

lucalamalfa91 opened this issue Oct 14, 2024 · 3 comments
Labels
exporter/loki Loki Exporter help wanted Extra attention is needed Stale unmaintained Identifies issues/prs for unmaintained components

Comments

@lucalamalfa91
Copy link

Component(s)

exporter/loki

Details

The current example for the Loki exporter in the otelcol-contrib repository is not outdated but will be deprecated from 2024 November 1. It uses the loki exporter with the following configuration:

receivers:
  journald:
    directory: /var/log/journal/a04e3a44cdd740f88d6a7ae3bb8c70cf

exporters:
  debug:
    verbosity: detailed
  loki:
    endpoint: http://localhost:3100/loki/api/v1/push
    tls:
      insecure: true

processors:
  attributes:
    actions:
    - action: insert
      key: loki.attribute.labels
      value: http_status_code

    - action: insert
      key: http_status_code
      value: 500

  resource:
    attributes:
    - action: insert
      key: loki.resource.labels
      value: host_name, pod_name

    - action: insert
      key: host_name
      value: guarana
    - action: insert
      key: pod_name
      value: guarana-pod-01

extensions:

service:
  extensions:
  pipelines:
    logs:
      receivers: [journald]
      processors: [resource, attributes]
      exporters: [debug, loki]

Proposed Changes
The example should be updated to reflect the new configuration using the otlphttp/loki exporter as follows:

receivers:
  journald:
    directory: /var/log/journal/a04e3a44cdd740f88d6a7ae3bb8c70cf

exporters:
  debug:
    verbosity: detailed
  otlphttp/loki:
    endpoint: "http://localhost:3100/otlp"
    tls:
      insecure: true

processors:
  attributes:
    actions:
    - action: insert
      key: loki.attribute.labels
      value: http_status_code

  resource:
    attributes:
    - action: insert
      key: loki.resource.labels
      value: host_name, pod_name

extensions:

service:
  extensions:
  pipelines:
    logs:
      receivers: [journald]
      processors: [resource, attributes]
      exporters: [debug, otlphttp/loki]

This update is important because the new version of Loki (>= 3.0) supports the OTLP standard. By using the otlphttp/loki exporter, users can take advantage of the latest features and improvements in Loki, ensuring a more streamlined and effective logging experience. The current configuration will no longer be supported after November 1, making this update essential for users.

@lucalamalfa91 lucalamalfa91 added help wanted Extra attention is needed unmaintained Identifies issues/prs for unmaintained components labels Oct 14, 2024
@github-actions github-actions bot added the exporter/loki Loki Exporter label Oct 14, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

walnuts1018 added a commit to walnuts1018/infra that referenced this issue Oct 15, 2024
open-telemetry/opentelemetry-collector-contrib#35770

Signed-off-by: walnuts1018 <r.juglans.1018@gmail.com>
@mar4uk
Copy link
Contributor

mar4uk commented Oct 17, 2024

Hello, thank you for reporting the issue!
I think the example directory should contain the config showing deprecated loki exporter usage, since it is loki exporter dedicated folder.

We already have an example of using otlphttp exporter instead of loki exporter in the README. We can add additional config with otlphttp exporter usage to the example directory so it has both variants: the old one and the new one. Would it be sufficient?

Copy link
Contributor

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.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exporter/loki Loki Exporter help wanted Extra attention is needed Stale unmaintained Identifies issues/prs for unmaintained components
Projects
None yet
Development

No branches or pull requests

2 participants