Advertisement
Guest User

Untitled

a guest
Jun 6th, 2025
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. local.common_labels = {
  2. environment = "staging"
  3. client = "client_name"
  4. job = ""
  5. }
  6.  
  7. //
  8. // prometheus
  9. //
  10. prometheus.scrape "backend" {
  11. scrape_interval = "30s"
  12. scrape_timeout = "5s"
  13. forward_to = [prometheus.remote_write.default.receiver]
  14. targets = [
  15. {
  16. "__address__" = "localhost:9002",
  17. "environment" = local.environment,
  18. },
  19. ]
  20. }
  21.  
  22. prometheus.remote_write "default" {
  23. endpoint {
  24. url = "https://<redacted>/prometheus/api/v1/write"
  25. }
  26. }
  27.  
  28. //
  29. // loki
  30. //
  31. loki.source.file "default" {
  32. tail_from_end = false
  33. targets = [
  34. {
  35. "__path__" = "E:\\indi\\prod\\logs\\api_prod.log",
  36. "environment" = local.environment,
  37. "job" = local.job,
  38. },
  39. ]
  40. forward_to = [
  41. loki.write.local.receiver,
  42. ]
  43. }
  44.  
  45. loki.write "local" {
  46. endpoint {
  47. url = "https://<redacted>/loki/api/v1/push"
  48. }
  49. }
  50.  
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement