Skip to content

Commit

Permalink
Merge pull request #2379 from amvanbaren/configure-tracing-attributes
Browse files Browse the repository at this point in the history
Add environment label
  • Loading branch information
amvanbaren authored Feb 22, 2024
2 parents eb3a2ed + ad56f34 commit 42347de
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion kubernetes/open-vsx.org.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,21 @@ local newGrafanaAgentConfigMap() = {
target_label: instance
static_configs:
- targets: ['localhost:8081']
labels:
environment: ${ENVNAME}
metrics_path: /actuator/prometheus
global:
scrape_interval: 60s
traces:
configs:
- name: default
attributes:
- key: environment
action: upsert
value: ${ENVNAME}
- key: instance
action: upsert
value: ${HOSTNAME}
remote_write:
- endpoint: ${TEMPO_URL}
basic_auth:
Expand Down Expand Up @@ -163,7 +172,8 @@ local newDeployment(env, dockerImage) = {
env: utils.pairList(self._env),
_env:: {
CONFIG_FILE_PATH: "/etc/grafana-agent/agent.yml",
DATA_FILE_PATH: "/etc/grafana-agent/data"
DATA_FILE_PATH: "/etc/grafana-agent/data",
ENVNAME: env.envName
},
envFrom: [
{
Expand All @@ -187,6 +197,7 @@ local newDeployment(env, dockerImage) = {
_env:: {
JVM_ARGS: (if (env.envName == "staging") then "-Dspring.datasource.hikari.maximum-pool-size=5 -Xms512M -Xmx1536M" else "-Xms4G -Xmx6G") + jvmPerfOptions,
DEPLOYMENT_CONFIG: "%s/%s" % [ env.deploymentConfig.path, env.deploymentConfig.filename, ],
ENVNAME: env.envName
},
envFrom: [
{
Expand Down
2 changes: 1 addition & 1 deletion logging/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</http>
<format>
<label>
<pattern>job=loki4j,instance=${HOSTNAME},application=${appName},traceID=%X{traceId:-NONE},level=%level</pattern>
<pattern>job=loki4j,environment=${ENVNAME},instance=${HOSTNAME},application=${appName},traceID=%X{traceId:-NONE},level=%level</pattern>
</label>
<message>
<pattern>${FILE_LOG_PATTERN}</pattern>
Expand Down

0 comments on commit 42347de

Please sign in to comment.