Skip to content

Commit

Permalink
Merge pull request #611 from mendix/develop
Browse files Browse the repository at this point in the history
Release 2023-03-20
  • Loading branch information
sailhenz authored Mar 20, 2023
2 parents a5822fc + 3df692d commit a5d1f1a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions buildpack/telemetry/telegraf.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ def update_config(m2ee, app_name):
dynatrace_enabled=dynatrace.is_telegraf_enabled(),
dynatrace_config=_get_dynatrace_config(app_name),
telegraf_debug_enabled=os.getenv("TELEGRAF_DEBUG_ENABLED", "false"),
telegraf_fileout_enabled=strtobool(os.getenv("TELEGRAF_FILEOUT_ENABLED", "false"))
)

logging.debug("Writing Telegraf configuration file...")
Expand Down
31 changes: 31 additions & 0 deletions etc/telegraf/telegraf.toml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -370,5 +370,36 @@
[outputs.http.tagpass]
micrometer_metrics = ["true"]

{% if telegraf_fileout_enabled %}
[[outputs.file]]
## Files to write to, "stdout" is a specially handled file.
files = ["/app/log/metrics.out"]

## The file will be rotated after the time interval specified. When set
## to 0 no time based rotation is performed.
rotation_interval = "12h"

## The logfile will be rotated when it becomes larger than the specified
## size. When set to 0 no size based rotation is performed.
# rotation_max_size = "0MB"

## Maximum number of rotated archives to keep, any older logs are deleted.
## If set to -1, no archives are removed.
rotation_max_archives = 5

## Data format to output.
## Each data format has its own unique set of configuration options, read
## more about them here:
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
data_format = "influx"

# tagexlude drops any non-relevant tags
tagexclude = ["host"]

# Pass only those metrics that has below tag set
[outputs.file.tagpass]
micrometer_metrics = ["true"]

{% endif %}
####################################################################################
{% endif %}

0 comments on commit a5d1f1a

Please sign in to comment.