Skip to content
Snippets Groups Projects

L2SS-1715: Configure vector to push logs to loki central

Merged L2SS-1715: Configure vector to push logs to loki central
1 unresolved thread
Merged Corné Lukken requested to merge L2SS-1715-push-loki-logs-to-central into master
1 unresolved thread
1 file
+ 14
0
Compare changes
  • Side-by-side
  • Inline
+ 14
0
@@ -137,6 +137,20 @@ healthchecks.require_healthy = true
@@ -137,6 +137,20 @@ healthchecks.require_healthy = true
[sinks.loki.labels]
[sinks.loki.labels]
"nomad_*" = '{{ nomad }}'
"nomad_*" = '{{ nomad }}'
 
[[ if ne .station "dev" ]]
 
[sinks.loki_central]
 
type = "loki"
 
inputs = [ "nomad-flags" ]
 
tenant_id = [[.station]]
 
endpoint = "http://logs.lofar-central.service.consul:3100"
    • Can't we push these urls from gitlab environment settings ? You can set it there very nicely per environment. Safes us one day from accidently pushing logs to the central service. But for now offcourse, this works.

      • Yes and no, accidentally pushing to prod is not going to happen, there is already a conditional around this (notice [[ if ne.station "dev" ]]. And both your local setup and the integration tests will never be able to reach the central Consul network so lofar-central.service.consul will not resolve.

        Cleaning up all these variables is nice however, but doing that for this one magic string doesn't make a lot of sense as to do it proper you need to change all these magic strings into variables. Which is well beyond the scope of this ticket.

      • Please register or sign in to reply
Please register or sign in to reply
 
encoding.codec = "json"
 
healthcheck.enabled = true
 
remove_label_fields = true
 
out_of_order_action = "accept"
 
[sinks.loki_central.labels]
 
"nomad_*" = '{{ nomad }}'
 
[[ end ]]
 
[sources.host_metrics]
[sources.host_metrics]
type = "host_metrics"
type = "host_metrics"
scrape_interval_secs = 10
scrape_interval_secs = 10
Loading