Skip to content

Any example on using Vector with Sentry? #20689

Answered by sveneld
LucianoVandi asked this question in Q&A
Discussion options

You must be logged in to vote
format_sentry_event:
    type: "remap"
    inputs: ["parse_logs"]
    source: |
      . = {
        "envelope_header": {
          "event_id": uuid_v4(),
          "dsn": "${SENTRY_DSN}"
        },
        "item_header": {"type": "event"},
        "payload": {
          "message": .message,
          "level": .level || "info",
          "timestamp": now(),
          "extra": .context 
        }
      }
  # Convert to Sentry envelope string format
  to_envelope:
    type: "remap"
    inputs: [ "format_sentry_event" ]
    source: |
      . = encode_json(.envelope_header) + "\n" +
          encode_json(.item_header) + "\n" +
          encode_json(.payload)
     

sinks:
  sentry_http:
    ty…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@pront
Comment options

@LucianoVandi
Comment options

Answer selected by LucianoVandi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants