Skip to content

Instantly share code, notes, and snippets.

@stympy
Created March 20, 2024 18:22
Show Gist options
  • Save stympy/561eabab4e86ec49e768e6c21c02c88a to your computer and use it in GitHub Desktop.
Save stympy/561eabab4e86ec49e768e6c21c02c88a to your computer and use it in GitHub Desktop.
[api]
enabled = true
address = "0.0.0.0:8686"
[sources.fly_log_metrics]
type = "internal_metrics"
[sources.sandwich]
type = "nats"
url = "nats://[fdaa::3]:4223"
queue = "${QUEUE-}"
subject = "logs.sandwich.>"
auth.strategy = "user_password"
auth.user_password.user = "${ORG-personal}"
auth.user_password.password = "${ACCESS_TOKEN?}"
connection_name = "Sandwich logs stream"
[sources.sub]
type = "nats"
url = "nats://[fdaa::3]:4223"
queue = "${QUEUE-}"
subject = "logs.sub.>"
auth.strategy = "user_password"
auth.user_password.user = "${ORG-personal}"
auth.user_password.password = "${ACCESS_TOKEN?}"
connection_name = "Sub logs stream"
[transforms.log_json]
type = "remap"
inputs = ["nats"]
source = '''
. = parse_json!(.message)
'''
[sinks.fly_log_metrics_prometheus]
type = "prometheus_exporter" # required
inputs = ["fly_log_metrics"] # required
address = "0.0.0.0:9598" # required
default_namespace = "fly-logs" # optional, no default
[sinks.blackhole]
type = "blackhole"
inputs = ["log_json"]
print_interval_secs = 100000
[sinks.honeybadger_sandwich]
type = "http"
inputs = ["sandwich"]
uri = "https://api.honeybadger.io/v1/events"
framing.method = "newline_delimited"
encoding.codec = "json"
request.headers = {"X-API-Key" = "Sandwich Key"}
[sinks.honeybadger_sub]
type = "http"
inputs = ["sub"]
uri = "https://api.honeybadger.io/v1/events"
framing.method = "newline_delimited"
encoding.codec = "json"
request.headers = {"X-API-Key" = "Sub Key"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment