-
Notifications
You must be signed in to change notification settings - Fork 537
otelcol.exporter.file: add file exporter component with configu… #4475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
271 commits
Select commit
Hold shift + click to select a range
dded822
Update changelog (#4512)
kalleep cf24b54
chore: point out breaking change in prometheus.scrape for v1.11 (#4516)
kalleep efd40c1
Db-O11y: Removing unnecessary samples from pg samples, adding user fi…
gaantunes 2fe5377
update helmchart with v1.11.0 (#4521)
kalleep d7e76a4
Reduce stripe series size by 4x (#4306)
kgeckhart a7ed249
database_observability: update alloy config examples to use targets (…
matthewnolf a7bf5bd
Remove labelstore usage from relabel and clarify certain use cases (#…
kgeckhart 4063338
docs: Update send-logs-to-loki.md (#4476)
hom3r 52215a4
Update windows install with Winget and new exe (#4506)
clayton-cornell 0eef803
Fix direction for pyroscope appendable on graph (#4529)
dehaansa b8ea80c
Remotecfg status (#4367)
erikbaranowski ff95782
beyla integration test less strict on trace duration (#4534)
erikbaranowski 61748ae
Fix WinGet submission automation (#4527)
martincostello 001f354
Add links to Learning Journeys (#4535)
clayton-cornell 129ac95
database_observability: in PG `schema_details` use `datname` in all l…
cristiangreco 9698bfd
remotecfg: don't log or reset last remote config status on not modifi…
erikbaranowski cbe304e
Update postgres_exporter to v0.18.1 (#4518)
cristiangreco d540615
Don't set `text_limit` for mysql collector (#4526)
cristiangreco aaa2430
database_observability: enable postgres collectors by default (#4537)
cristiangreco 9185e8d
Add docs note about converting promtail daemonset configs (#4464)
dehaansa 0a42e70
Update README with better user grants guidance (#4528)
cristiangreco 9f8cd17
fix: add logging wrapper for cloudwatch exporter with support for deb…
kalleep 941f41d
database_observability: add foreign keys to PG schema_details collect…
fridgepoet 2783b33
Update instructions for mysql user grants (#4552)
cristiangreco fad050b
adds references to label types (#4561)
kinsey-grafs 3345329
Remove old reference to default 8192 (#4570)
clayton-cornell 2943f28
fix instance key in exporters (#3356)
thampiotr 1164d57
loki.source.journal: fix deadlock (#4571)
thampiotr ec6d08a
Use sync timeout to decide how long to retry waiting for k8s api for …
dehaansa 116795f
Update changelog on main (#4575)
kalleep b806cc1
chore(pyroscope.write): decouple from alloy (#4500)
korniltsev-grafanista 6baf8da
scheduler: add component shutdown timeout of 10m (#4577)
thampiotr 2eb550e
chore: remove unused fields in loki client code (#4579)
kalleep 148c71c
database_observability: cache pg sample and wait events before sendin…
gaantunes 5e0e977
Remove some loki/v3 dependencies (#4576)
ptodev fb68f87
pyroscope.java: allow custom asprof distributions instead of embeded …
korniltsev-grafanista 95afb9f
postgres_exporter: expose stat_statements.include_query (#4372)
SimonSerrano c4280f4
REPL: Initial GraphQL Schema (#4214)
jharvey10 a850bfd
chore: don't error log when context in canceled (#4583)
kalleep 643d5eb
fix loki.source.file and loki.source.journal deadlocks on shutdown (#…
thampiotr d4ca23e
Reuse the same builder instance in relabel.process() (#4578)
blewis12 5256a0f
fix: loki.source.file drain tasks on exit (#4593)
kalleep 434fa25
update changelog for V1.11.2 (#4582)
kalleep 138e918
Change log level of EOF errors in loki.source.syslog (#4590)
dehaansa 5b4f106
database_observability: add caching to Postgres schema details collec…
fridgepoet 541a2a9
Update logs-in-kubernetes docs to warn users about daemonsets (#4160)
dehaansa 990a7d0
helm release (#4600)
kalleep 7630547
fix: stop loki.source.kubernetes discarding log lines with duplicate …
ciaranj db717ea
database_observability: Postgres explain plan improvements (#4542)
rgeyer 36e1e96
Update build image to use golang v1.25.1 (#4546)
kalleep de98d69
Mark 1.11 as released in docs (#4616)
dehaansa 570d3b4
fix: panic when no tcp block is used for otelcol.receiver.syslog (#4628)
kalleep aa7a65f
fix: loki source file scheduleloop (#4634)
kalleep ea2bf90
database_observability: use query_start as a key instead of xid for q…
gaantunes c3fb205
Greater control over RBAC objects and rules (#3869)
petewall 9f5b4cf
Fix CRD translations to propagate scrape protocols (#4638)
dehaansa a90bc13
Fix splunkhec arguments missing new block (#4612)
dehaansa 3c09533
Update to use go 1.25.1 (#4637)
kalleep aaea6c0
fix: trigger the sync job when targets are updated (#4635)
kalleep f007a03
enhance stage.luhn to support numbers with delimiters (#4588)
dehaansa 357f004
Use $__rate_interval in query (#4648)
kalleep 4e9eab8
database_observability: refactor mysql list of excluded schemas (#4647)
cristiangreco 92c1b8b
Update Beyla component to 2.7.4 (#4543)
grcevski 4bceeed
fix: improve debug info for various receivers (#4655)
kalleep 1968f2b
feat: prometheus.exporter.static (#4173)
kalleep 8c29402
Upgrade Prometheus to v3.7.1 and resolve issues (#4636)
thampiotr d7c08e7
update CODEOWNERS for database_observability (#4649)
cristiangreco 6e56fd1
Revert "Upgrade Prometheus to v3.7.1 and resolve issues (#4636)" (#4667)
erikbaranowski f27bf3d
Docs: Fix broken link in sources/troubleshoot/debug (#4653)
tiffanyfay a9fad7c
Expose ARP collector config options. (#4669)
ptodev 294fb95
V1.11.3 main (#4657)
kalleep 9da8780
Update Snowflake exporter dependency to latest (#4665)
Dasomeone 71d71dc
Add `cloud_provider` block to `database_observability.postgres` (#4675)
cristiangreco cc777fd
Fix issues from textparser breaking change (#4674)
kgeckhart 90e6276
Update helm chart to v1.4.0 (#4694)
kalleep 9138811
database_observability: update docs to reflect latest changes in READ…
cristiangreco fd084df
docs(prometheus.scrape): Augment prometheus.scrape 'scheme' argument …
lewismc 56476f8
Implement a truncate stage for loki.process (#4587)
dehaansa f24e144
clarifies component name and export references (#4692)
tto11y af4d843
database_observability: add database discovery to Postgres schema det…
fridgepoet 0a2d663
chore(pyroscope.java) upgrade to asprof 4.2 (#4658)
korniltsev-grafanista ab1473a
dbo11y: update default `collect_interval` for mysql `query_samples` (…
cristiangreco cc3f938
small fix in example config (#4710)
matthewnolf be9265c
fix(loki.source.podlogs): conditionally register field index for spec…
QuentinBisson ffa9ecc
point to another commit (#4712)
fridgepoet b3b1b04
feat: add awsecscontainermetrics receiver (#4205)
gregbrowndev e29ec5e
labelstore: Allow local links to be replaced (#4641)
kgeckhart c807bb2
TraceContext lost in faro receiver for exceptions (#4664)
duartesaraiva98 75b2878
feat: implement otel-ebpf-profiler uprobe profiling (#4663)
luweglarz 421cfc0
revises clustering best practices for load balancing (#4709)
tto11y d0fddae
fix: use new scheduler for loki source file (#4711)
kalleep a489da8
Reapply Prometheus upgrade and fix ckit & upstream issue (#4671)
thampiotr db2670a
filter out databases where the user lacks connect privileges (#4733)
fridgepoet bac6a6a
database_observability: don't log query text if redaction is enabled …
cristiangreco 9388c4c
add error tests (#4730)
fridgepoet 966235a
docs: document pyroscope.ebpf off_cpu_threshold arg as float instead …
luweglarz 8f44e99
docs: fix capability typo in beyla.ebpf component documentation (#4740)
in-jun a39498c
add verbose_mode field to pyroscope.ebpf to configure otel-ebpf-contr…
luweglarz 84a72d7
Loki Write: Internal Labels (#4601)
matt-gp e9249bf
Use labels.Labels API For String Label Compatibility Part 2 (#4690)
blewis12 c58ee7d
feat(loki.source.podlogs): add preserve_discovered_labels option (#4606)
QuentinBisson c7d37d0
test(beyla): add missing trace attribute (#4757)
skl ddbf77e
ci: hold prometheus/common dep as unstable on dashboard (#4677)
jharvey10 60d2727
chore(deps): update grafana/shared-workflows/dockerhub-login action t…
renovate-sh-app[bot] e326e60
fix: pass RemoveEmptyGroups to process exporter config (#4644)
mhamzahkhan 02cb7eb
Support a histogram which is both classic and native (#4309)
ptodev be0d29a
fix(metrics/wal): missing NHCBs failure (#4762)
krajorama f6d63a3
ci: add ai-review workflow (#4707)
jharvey10 41389dd
database_observability: Pass queries for explain plans more permissiv…
rgeyer d02ab07
chore(deps): update github-actions dependencies (#4766)
renovate-sh-app[bot] 8375425
Remove more loki/v3 dependencies (#4594)
ptodev bf9a13d
Fix races reported in Alloy tests (#4059)
bboreham f6526e5
chore: cleanup loki wal code (#4773)
kalleep c041396
Move stages under promtail and move / cleanup windows specific target…
kalleep 474bf56
implement the remotecfg effective config feature (#4714)
erikbaranowski e8de98f
chore: cleanup targets and stages (#4777)
kalleep 675b066
promote db-o11y components to public preview stability (#4763)
matthewnolf efbebe1
fix(pyroscope.ebpf): Explicitly show unknown frames from libpf.AbortF…
bobrik c275aeb
feat: loki.source.file file_match block (#4743)
kalleep 80b3f07
Enable explain_plans collector by default for dbo11y, pgsql and mysql…
rgeyer 6437128
Temporarily add slicelabels tag to the doc generator (#4790)
blewis12 7ff0a18
chore: more loki cleanup (#4780)
kalleep 67c95ef
database_observability: handle null server_ip/port in server_id gener…
matthewnolf c315035
use correct function to join path (#4792)
kalleep c0a5f11
database_observability: Reduce info level logging noise for explain p…
rgeyer 240b951
chore(deps): update module github.com/opencontainers/runc to v1.3.3 […
renovate-sh-app[bot] 566a246
database_observability: Consider compound keywords in queries when de…
rgeyer a6f6b1c
ui: replace create-react-app with vite (#4736)
jharvey10 5a1ade9
Better support for tailing non-UTF-8 files (#4794)
ptodev 099f452
remotecfg: use POST requests for GetConfig (#4803)
tpaschalis ffea3ed
chore: cleanup tail and fix locks (#4802)
kalleep 8876497
feat(alloy): add cloudflare receiver (#4781)
x1unix 631f51e
database_observability: Fix a few small things discovered in dogfoodi…
rgeyer acf9096
chore: Fix unversioned systemd dependency (#4807)
mrueg a7ba36e
database_observability: add table registry cache to schema_details an…
fridgepoet d60410b
feat(faro): add per-app rate limiting for receiver (#4688)
hhertout 3cce8d9
database_observability: consider idle states to calculate Postgres qu…
gaantunes 4f88506
Remove invalid creationTimestamp (#4731)
vehagn bfb7bb0
loki.source.api: cancel in-flight requests when graceful shutdown per…
kalleep 22c4f7b
fix: delegate check of Enabled check in our slog wrapper (#4812)
kalleep 3c42989
feat(loki.process): add regex field to structured_metadata stage (#4629)
timonegk 58a27bd
chore: tail fixes (#4821)
kalleep 6eca8dc
Fix flaky test for structured metadata stage (#4828)
dehaansa 63ffd2b
Add mutex to missing tail.reader usage (#4829)
dehaansa 6a669ec
Cleanup structured metadata test code (#4830)
ptodev 8b7b433
Implement behavior in loki.source.file to handle corrupted positions …
dehaansa e2ae31d
database_observability: Keep evaluating queries for reserved words af…
rgeyer 2f74557
chore(deps): update github-actions dependencies (#4809)
renovate-sh-app[bot] 5b35959
chore(deps): update module github.com/opencontainers/selinux to v1.13…
renovate-sh-app[bot] f88045f
Fix the way loki.write configures HTTP2 (#4835)
dehaansa d7c3830
OTel v0.139.0 (#4816)
dehaansa 7a94688
Add support for attaching namespace metadata to kubernetes.discovery …
kgeckhart 5de86ac
Db-o11y: parse pg queries with quotes correctly (#4843)
gaantunes 14dc5bb
Support cleaning up newlines in stage.multiline (#4841)
dehaansa 9d588a5
Correct `extraEnv` indentation in container template (#4831)
orkhan-huseyn b3c51c6
ci: increase runner size for pr tests (#4852)
jharvey10 73438e8
docs: fix changelog (#4855)
jharvey10 152eb60
Db-o11y: fix flaky tests (#4854)
gaantunes 8167ef6
Fix git checkout command for release branch (#4859)
jharvey10 f061ecb
feat: update converter to use file_match block (#4791)
kalleep 6bbceae
database_observability: add database exclude list for Postgres (#4819)
fridgepoet a336f88
chore: refactor loki client code (#4840)
kalleep c819d13
fix: no longer drop request if stream is dropped in loki.source.api (…
kalleep d798378
Fix publish workflow (#4866)
jharvey10 f3c2155
Fix docker block docs (#4836)
dehaansa c8460d7
Fix flaky tests: port in for loki source api tests and logs integrati…
kgeckhart b1530a4
docs: correct __journal_priority label name to have one underscore (#…
friedow 7e36b08
Fix: Address Remaining Stringlabels Issues Before Enabling (#4810)
blewis12 0e66428
Add a new mimir.alerts.kubernetes component (#3448)
ptodev b1a26c1
database_observability: fix schema_details collector to fetch column …
fridgepoet a835d3e
chore: refactor loki.write manager (#4863)
kalleep 96f59ce
Remove experimental flag from stage.windowsevent (#4879)
kgeckhart e02aeeb
Fix some Alloy syntax typos (#4876)
clayton-cornell 3331283
ci: move artifact download after checkout (#4885)
jharvey10 2e66871
chore: loki.process cleanup (#4893)
kalleep 6715047
beyla: add meta_cache_address to beyla.ebpf.attributes.kubernetes (#4…
skl ac79fb8
chore: fix tests that fail on windows (#4878)
dehaansa b723726
feat: pyroscope.enrich component (#4797)
AndreZiviani 958bc99
Upgrade Beyla component to 2.7.7 (#4891)
grcevski cc65773
Update monitor-kubernetes-logs.md (#4892)
ibuiltthis 9e61179
Traceparent option (#4874)
MyDigitalLife 7047ca3
chore: move position from common/loki to an internal package for loki…
kalleep 067a951
Fix lint in targets.go and add a test for potential issue (#4903)
thampiotr 86c2213
chore: remove /common/loki/utils (#4902)
kalleep 7ea71ef
Enable stringlabels (#4756)
blewis12 3f2a135
chore: replace fake.Client with CollectingHandler (#4904)
kalleep 1e372ea
Fix race in tests (#4907)
kalleep 753480b
Vendor Alertmanager config (#4905)
ptodev 4d94f72
feat(component/otelcol/connector): add support for logs to metrics c…
yann-soubeyrand d86d366
Remove slicelabels tag from generate (#4916)
blewis12 23f665b
database_observability: mark mysql component as public preview (#4919)
cristiangreco a0f828b
fix(pyroscope.ebpf): Use meter noop in otel-ebpf-profiler (#4920)
simonswine 7ad4e8e
redirect from Alloy readme to docs site (#4918)
fridgepoet 02f09fa
Refactor topic to fix errors (#4909)
clayton-cornell 67750d0
Update otelcol.exporter.splunkhec.md (#4924)
isujtauke 0272180
fix typo in ecs data collection doc (#4925)
jharvey10 94d4d27
database_observability: add more supporting information to error logs…
fridgepoet 818bf9b
fix(loki.source.podlogs): set validation scheme (#4931)
kalleep af3e531
chore(deps): update module github.com/dvsekhvalnov/jose2go to v1.7.0 …
renovate-sh-app[bot] bc11f06
database_observability: log explain plan fetch error at debug (#4935)
cristiangreco 4784578
feat(otelcol.receiver): add awss3 receiver (#4928)
x1unix 4ff2297
feat(otelcol): add support for htpasswd file authentication (#3916)
pkarakal d5ee47c
chore: remove loki imports in loki.source.api (#4939)
kalleep c5a9bd2
fix changelog (sync with 1.12) (#4944)
jharvey10 45b5ce4
chore: cleanup loki imports (#4930)
kalleep 3a0975d
db-o11y: change the server_id calculation for mysql (#4943)
gaantunes a64c4f1
move main to next minor release (#4960)
jharvey10 1127c07
Refactor the Alloy Get Started topics (#4591)
clayton-cornell 21ff67e
chore(doc): admonition for API saturation risk (#4955)
adrian-salas 0dbc145
chore(deps): update grafana/shared-workflows/get-vault-secrets action…
renovate-sh-app[bot] 3f69061
chore(deps): update github-actions dependencies (#4915)
renovate-sh-app[bot] 7e98fd8
fix(deps): update module golang.org/x/crypto to v0.45.0 [security] (#…
renovate-sh-app[bot] b34a4b7
Fix broken link definitions (#4965)
clayton-cornell b0d7b96
only ignore alloy at top level (#4967)
jharvey10 979c6d5
Fix broken links in admonition (#4971)
clayton-cornell 6dec702
feat: Add lazy mode argument to pyroscope.ebpf (#4824)
luweglarz f1b53cd
update helm chart to v1.5.0 (#4968)
jharvey10 27095e9
docs: adjust remove_empty_groups in prometheus.exporter.process (#4979)
jharvey10 ee4f028
Fix aliases in Get started documentation (#4990)
clayton-cornell 60b016a
database_observability: Always log an explain_plan_output for each qu…
rgeyer 7016893
Fix broken link in admonition (#4988)
clayton-cornell f999fab
dbo11y: stop tracking alloy's own queries in mysql (#4978)
cristiangreco 3d0e1ff
remove unneeded build tags (#4995)
kalleep edad061
stage.cri: remove wrong output stage (#5002)
kalleep 6cc321f
feat: add delay option to CW exporter (#4936)
tmeijn d16c6a9
Support scraping native histograms from the prometheus CRDs (#4750)
dehaansa 39ce460
Add two more missing aliases (#5000)
clayton-cornell 034b8ed
Update the Debug topic to add detailed information about logs (#4245)
clayton-cornell 70fbd0d
enhancement: support http SD in scrapeconfigs (#4826)
QuentinBisson b2a4a08
loki.write: always read and close response body (#4994)
kalleep b44a0bc
feat(otelcol.connector): adding connector count (#4913)
hhertout e2d1507
update go to v1.25.5 in build image (#5014)
kalleep 0e8b1e6
Update to Beyla 2.7.10 (#5019)
rafaelroquetto accabf1
Add missing information to the prometheus.exporter.oracledb component…
clayton-cornell 9bd1e1f
update to go v1.25.5 (#5027)
kalleep 83772b4
Introduce Shared YAML Dependency File To Manage Replace Directives (#…
blewis12 33f71be
fix: add StoreBuilder to mimir.alerts.kubernetes eventProcessor (#5010)
synthe102 b309c8f
Add changelog for PR 5002 (#5042)
dehaansa 6f026e5
Fix missing release note for v1.12 (#5043)
thampiotr 912231a
remove labelstore from prometheus interceptor (#4890)
kgeckhart 2ccd927
Fix handling of multiplexed long lines in Docker logs (#4713)
axd1x8a ee4d200
add cloud-provider labels to target metrics (#4942)
matthewnolf d465261
stop storage and wal after test (#5056)
kalleep 2a5ae04
Update github issue templates
dehaansa 777a1e5
Update tests and add converter test
dehaansa 68b4dbb
Merge remote-tracking branch 'origin/main' into madhub/main
dehaansa 424d3b5
Fix bad merge
dehaansa f1624f0
regen docs
dehaansa 90f46f9
tweak from linter
dehaansa d1d9e55
remove diags from file exporter converter test
dehaansa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
246 changes: 246 additions & 0 deletions
246
docs/sources/reference/components/otelcol/otelcol.exporter.file.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,246 @@ | ||
| --- | ||
| canonical: https://grafana.com/docs/alloy/latest/reference/components/otelcol/otelcol.exporter.file/ | ||
| description: Learn about otelcol.exporter.file | ||
| labels: | ||
| stage: general-availability | ||
| products: | ||
| - oss | ||
| tags: | ||
| - text: Community | ||
| tooltip: This component is developed, maintained, and supported by the Alloy user community. | ||
madhub marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| title: otelcol.exporter.file | ||
| --- | ||
|
|
||
| # `otelcol.exporter.file` | ||
|
|
||
| {{< docs/shared lookup="stability/community.md" source="alloy" version="<ALLOY_VERSION>" >}} | ||
|
|
||
| `otelcol.exporter.file` accepts metrics, logs, and traces telemetry data from other `otelcol` components and writes it to files on disk. | ||
madhub marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| You can write data in JSON or Protocol Buffers `proto` format. | ||
| You can optionally enable file rotation, compression, and separate output files based on a resource attribute. | ||
|
|
||
| {{< admonition type="note" >}} | ||
| `otelcol.exporter.file` is a wrapper over the upstream OpenTelemetry Collector Contrib [`fileexporter`][] exporter. | ||
| Bug reports or feature requests will be redirected to the upstream repository, if necessary. | ||
|
|
||
| [`fileexporter`]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/{{< param "OTEL_VERSION" >}}/exporter/fileexporter | ||
| {{< /admonition >}} | ||
|
|
||
| You can specify multiple `otelcol.exporter.file` components by giving them different labels. | ||
|
|
||
| ## Usage | ||
|
|
||
| ```alloy | ||
| otelcol.exporter.file "<LABEL>" { | ||
| path = "<PATH>" | ||
| } | ||
| ``` | ||
|
|
||
| ## Arguments | ||
|
|
||
| You can use the following arguments with `otelcol.exporter.file`: | ||
|
|
||
| | Name | Type | Description | Default | Required | | ||
| | ---------------- | ---------- | -------------------------------------------------------- | -------- | -------- | | ||
| | `path` | `string` | Path to the file to write telemetry data. | | yes | | ||
| | `append` | `bool` | Append to the file when `true`; truncate when `false`. | `false` | no | | ||
| | `compression` | `string` | Compression algorithm. Alloy supports only `"zstd"`. | | no | | ||
| | `flush_interval` | `duration` | Time between flushes to disk. Must be greater than zero. | `"1s"` | no | | ||
| | `format` | `string` | Data format. Must be `"json"` or `"proto"`. | `"json"` | no | | ||
|
|
||
| You can't enable `append` and `compression` together. | ||
|
|
||
| {{< admonition type="note" >}} | ||
| The upstream `encoding` argument isn't supported. | ||
| Use `format` instead. | ||
| {{< /admonition >}} | ||
|
|
||
| ## Blocks | ||
|
|
||
| You can use the following blocks with `otelcol.exporter.file`: | ||
|
|
||
| | Block | Description | Required | | ||
| | -------------------------------- | -------------------------------------------------------------------- | -------- | | ||
| | [`debug_metrics`][debug_metrics] | Configures internal metrics for this component. | no | | ||
| | [`group_by`][group_by] | Writes to separate files based on a resource attribute value. | no | | ||
| | [`rotation`][rotation] | Configures file rotation. Ignored when `group_by.enabled` is `true`. | no | | ||
|
|
||
| You can't enable `append` and `rotation` together. | ||
|
|
||
| [debug_metrics]: #debug_metrics | ||
| [group_by]: #group_by | ||
| [rotation]: #rotation | ||
|
|
||
| ### `debug_metrics` | ||
|
|
||
| {{< docs/shared lookup="reference/components/otelcol-debug-metrics-block.md" source="alloy" version="<ALLOY_VERSION>" >}} | ||
|
|
||
| ### `group_by` | ||
|
|
||
| The `group_by` block writes telemetry to separate files based on a resource attribute. | ||
|
|
||
| | Name | Type | Description | Default | Required | | ||
| | -------------------- | -------- | ------------------------------------------------------ | ----------------------------- | -------- | | ||
| | `enabled` | `bool` | Enable `group_by` behavior. | `false` | no | | ||
| | `max_open_files` | `int` | Maximum number of simultaneously open files. | `100` | no | | ||
| | `resource_attribute` | `string` | Resource attribute whose value replaces `*` in `path`. | `"fileexporter.path_segment"` | no | | ||
|
|
||
| When `group_by.enabled` is `true`: | ||
|
|
||
| - `path` must contain exactly one `*` character. | ||
| - The exporter replaces the `*` with the `resource_attribute` value. | ||
| - `rotation` settings don't apply. | ||
|
|
||
| ### `rotation` | ||
|
|
||
| The `rotation` block configures rolling log file behavior. | ||
|
|
||
| | Name | Type | Description | Default | Required | | ||
| | --------------- | ------ | --------------------------------------------------------------------- | ------- | -------- | | ||
| | `localtime` | `bool` | Use local time instead of UTC in rotated filenames. | `false` | no | | ||
| | `max_backups` | `int` | Maximum number of rotated files to retain. | `100` | no | | ||
| | `max_days` | `int` | Maximum number of days to retain files. `0` keeps files indefinitely. | `0` | no | | ||
| | `max_megabytes` | `int` | Maximum size in megabytes before the file rotates. | `100` | no | | ||
|
|
||
| ## Exported fields | ||
|
|
||
| `otelcol.exporter.file` doesn't export any fields. | ||
|
|
||
| ## Component health | ||
|
|
||
| `otelcol.exporter.file` is only reported as unhealthy if given an invalid configuration. | ||
|
|
||
| ## Debug information | ||
|
|
||
| `otelcol.exporter.file` doesn't expose any component-specific debug information. | ||
|
|
||
| ## Examples | ||
|
|
||
| The following examples demonstrate how you can use `otelcol.exporter.file`. | ||
|
|
||
| ### Basic file export | ||
|
|
||
| ```alloy | ||
| otelcol.exporter.file "default" { | ||
| path = "/tmp/traces.json" | ||
| } | ||
| ``` | ||
|
|
||
| ### File export with rotation | ||
|
|
||
| ```alloy | ||
| otelcol.exporter.file "rotated" { | ||
| path = "/var/log/telemetry.json" | ||
| format = "json" | ||
|
|
||
| rotation { | ||
| max_megabytes = 50 | ||
| max_days = 7 | ||
| max_backups = 10 | ||
| localtime = true | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### File export with compression | ||
|
|
||
| ```alloy | ||
| otelcol.exporter.file "compressed" { | ||
| path = "/tmp/traces.jsonl" | ||
| format = "proto" | ||
| compression = "zstd" | ||
| } | ||
| ``` | ||
|
|
||
| ### Group by resource attribute | ||
|
|
||
| ```alloy | ||
| otelcol.exporter.file "grouped" { | ||
| path = "/tmp/logs/*/service.log" | ||
|
|
||
| group_by { | ||
| enabled = true | ||
| resource_attribute = "service.name" | ||
| max_open_files = 50 | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### Complete pipeline | ||
|
|
||
| ```alloy | ||
| otelcol.receiver.otlp "default" { | ||
| grpc { | ||
| endpoint = "0.0.0.0:4317" | ||
| } | ||
|
|
||
| http { | ||
| endpoint = "0.0.0.0:4318" | ||
| } | ||
|
|
||
| output { | ||
| metrics = [otelcol.exporter.file.default.input] | ||
| logs = [otelcol.exporter.file.default.input] | ||
| traces = [otelcol.exporter.file.default.input] | ||
| } | ||
| } | ||
|
|
||
| otelcol.exporter.file "default" { | ||
| path = "/tmp/telemetry.json" | ||
| format = "json" | ||
| flush_interval = "5s" | ||
|
|
||
| rotation { | ||
| max_megabytes = 100 | ||
| max_backups = 5 | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Technical details | ||
|
|
||
| The `otelcol.exporter.file` component writes telemetry data to files on disk in either JSON or Protocol Buffers format. | ||
| It supports: | ||
|
|
||
| - **File rotation**: Automatically rotate files based on size, age, or number of backups | ||
| - **Compression**: Compress output files using `zstd` algorithm | ||
| - **Group by attributes**: Write to different files based on resource attribute values | ||
| - **Flushing**: Configurable flush intervals to control write frequency | ||
|
|
||
| ### File formats | ||
|
|
||
| - **JSON format**: Each telemetry record is written as a separate line in JSON format (JSONL) | ||
| - **`proto` format**: Binary Protocol Buffers format with length-prefixed messages | ||
|
|
||
| ### File naming with rotation | ||
|
|
||
| When rotation is enabled, rotated files are renamed with a timestamp: | ||
|
|
||
| - Original: `data.json` | ||
| - Rotated: `data-2023-09-20T10-30-00.123.json` | ||
|
|
||
| ### Group by functionality | ||
|
|
||
| When `group_by` is enabled, files are created dynamically based on resource attribute values: | ||
|
|
||
| - Path template: `/logs/*/app.log` | ||
| - Resource attribute `service.name=frontend` | ||
| - Resulting file: `/logs/frontend/app.log` | ||
|
|
||
| <!-- START GENERATED COMPATIBLE COMPONENTS --> | ||
|
|
||
| ## Compatible components | ||
|
|
||
| `otelcol.exporter.file` can accept arguments from the following components: | ||
|
|
||
| - Components that export [OpenTelemetry `otelcol.Consumer`](../otelcol/#opentelemetry-otelcolconsumer-exporters) | ||
|
|
||
| `otelcol.exporter.file` has exports that can be consumed by the following components: | ||
|
|
||
| - Components that consume [OpenTelemetry `otelcol.Consumer`](../otelcol/#opentelemetry-otelcolconsumer-exporters) | ||
|
|
||
| {{< admonition type="note" >}} | ||
| Connecting some components may not be sensible or components may require further configuration to make the connection work correctly. Refer to the linked documentation for more details. | ||
| {{< /admonition >}} | ||
|
|
||
| <!-- END GENERATED COMPATIBLE COMPONENTS --> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.