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

Promtail receiver draft #10109

Closed
wants to merge 3 commits into from

Conversation

mar4uk
Copy link
Contributor

@mar4uk mar4uk commented May 17, 2022

Description:

Added new promtail receiver component. It is draft version just to feel how it could look like

Link to tracking Issue:
#9800

Documentation:

Currently this receiver supports scrape_config static_configs and scrape_configs loki_push_api. I didn't check other scrape_config targets (syslog, kubernetes, window_events), some additional fixes probably needed to make them work
The config file could look like:

receivers:
  promtail:
    config:
      positions:
        filename: /tmp/positions.yaml
        sync_period: 10s
      scrape_configs:
        - job_name: system
          static_configs:
            - labels:
                job: varlogs
                __path__: /var/log/example.log
        - job_name: push
          loki_push_api:
            server:
              http_listen_port: 3101
              grpc_listen_port: 3600
            labels:
              pushserver: push1
            use_incoming_timestamp: true
      target_config:
        sync_period: 10s

processors:
  batch:

exporters:
  logging:
    logLevel: debug
  loki:
    endpoint: "http://localhost:3100/loki/api/v1/push"
    labels:
      attributes:
        pushserver:
        foo:

service:
  pipelines:
    logs:
      receivers: [ promtail ]
      processors: [ batch ]
      exporters: [ logging, loki ]

To send logs to loki via collector we can run curl:

curl -i -XPOST -H "Content-Type: application/json" "http://localhost:3101/loki/api/v1/push" -d '{
  "streams": [
    {
      "stream": {
        "foo": "bar"
      },
      "values": [
          [ "1652782740000000000", "def" ]
      ]
    }
  ]
}'

To send logs to loki via collector we tail file example.log. It could be tested with command:

echo "May 04 11:45:56 Irinas-MBP login[87256]: USER_PROCESS: 87256 ttys012" >> example.log

Open question:

More context could be found in discussions:

@mar4uk mar4uk force-pushed the promtail-receiver-draft branch from 91d13e7 to c560b45 Compare May 17, 2022 12:22
@github-actions
Copy link
Contributor

github-actions bot commented Jun 1, 2022

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Jun 1, 2022
@djaglowski
Copy link
Member

Closing this per conclusion of #9800. I hope we can find a way to support this in the future without requiring a copyleft dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants