Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local.common_labels = {
- environment = "staging"
- client = "client_name"
- job = ""
- }
- //
- // prometheus
- //
- prometheus.scrape "backend" {
- scrape_interval = "30s"
- scrape_timeout = "5s"
- forward_to = [prometheus.remote_write.default.receiver]
- targets = [
- {
- "__address__" = "localhost:9002",
- "environment" = local.environment,
- },
- ]
- }
- prometheus.remote_write "default" {
- endpoint {
- url = "https://<redacted>/prometheus/api/v1/write"
- }
- }
- //
- // loki
- //
- loki.source.file "default" {
- tail_from_end = false
- targets = [
- {
- "__path__" = "E:\\indi\\prod\\logs\\api_prod.log",
- "environment" = local.environment,
- "job" = local.job,
- },
- ]
- forward_to = [
- loki.write.local.receiver,
- ]
- }
- loki.write "local" {
- endpoint {
- url = "https://<redacted>/loki/api/v1/push"
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement