Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@elohmeier
Copy link
Contributor

Summary

Extracted the Influx Line Protocol serialization code into the codecs module and added support for the http/websocket sinks to use it. This enables neat features like being able to use the Grafana Live feature. E.g. with the Vector config below I was able to stream the Vector metrics into Grafana.

To test this you can start a Grafana instance via docker run --rm -p 3000:3000 --name=grafana grafana/grafana and then on http://localhost:3000/org/serviceaccounts create a service account (I just gave it admin access) and then create a token for the Bearer authentication. You can then query metrics from the integrated -- Grafana -- data source (see the screenshot below).

Screenshot 2025-10-22 at 05 36 10

The functionality in Grafana to query this data is currently quite limited but I think this might still be useful for quickly plotting and exploring data e.g. during development of a Vector configuration file.

Vector configuration

sources:
  vector_metrics:
    type: internal_metrics
sinks:
  grafana:
    type: websocket
    inputs:
      - vector_metrics
    uri: ws://127.0.0.1:3000/api/live/push/vector
    encoding:
      codec: influxdb
    auth:
      strategy: bearer
      token: glsa_...

How did you test this PR?

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

Notes

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • Some CI checks run only after we manually approve them.
    • We recommend adding a pre-push hook, please see this template.
    • Alternatively, we recommend running the following locally before pushing to the remote branch:
      • make fmt
      • make check-clippy (if there are failures it's possible some of them can be fixed with make clippy-fix)
      • make test
  • After a review is requested, please avoid force pushes to help us review incrementally.
    • Feel free to push as many commits as you want. They will be squashed into one before merging.
    • For example, you can run git merge origin master and git push.
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please
    run make build-licenses to regenerate the license inventory and commit the changes (if any). More details here.

@elohmeier elohmeier requested review from a team as code owners October 22, 2025 03:43
@github-actions github-actions bot added domain: sinks Anything related to the Vector's sinks domain: codecs Anything related to Vector's codecs (encoding/decoding) domain: external docs Anything related to Vector's external, public documentation labels Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: codecs Anything related to Vector's codecs (encoding/decoding) domain: external docs Anything related to Vector's external, public documentation domain: sinks Anything related to the Vector's sinks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants