Skip to content
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

[receiver/loki] Enable component #20853

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .chloggen/enable-loki-reciver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: 'new_component'

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: lokireceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Mark loki receiver as Alpha

# One or more tracking issues related to the change
issues: [18635]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
6 changes: 5 additions & 1 deletion cmd/configschema/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/bmatcuk/doublestar/v4 v4.6.0 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/caio/go-tdigest v3.1.0+incompatible // indirect
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
Expand Down Expand Up @@ -393,7 +394,7 @@ require (
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/gosnmp/gosnmp v1.35.0 // indirect
github.com/grafana/loki/pkg/push v0.0.0-20230213181200-0394b56368d2 // indirect
github.com/grafana/loki/pkg/push v0.0.0-20230321110627-5c3d204ebf5d // indirect
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd // indirect
github.com/grobie/gomemcache v0.0.0-20180201122607-1f779c573665 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 // indirect
Expand Down Expand Up @@ -500,6 +501,7 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.75.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.75.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/winperfcounters v0.75.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/lokireceiver v0.75.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc2 // indirect
github.com/opencontainers/runc v1.1.5 // indirect
Expand Down Expand Up @@ -949,6 +951,8 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafka

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kubeletstatsreceiver => ../../receiver/kubeletstatsreceiver

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/lokireceiver => ../../receiver/lokireceiver

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/memcachedreceiver => ../../receiver/memcachedreceiver

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbreceiver => ../../receiver/mongodbreceiver
Expand Down
5 changes: 3 additions & 2 deletions cmd/configschema/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cmd/otelcontribcol/builder-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ receivers:
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkametricsreceiver v0.75.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver v0.75.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kubeletstatsreceiver v0.75.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/lokireceiver v0.75.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/memcachedreceiver v0.75.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbatlasreceiver v0.75.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbreceiver v0.75.0
Expand Down Expand Up @@ -369,6 +370,7 @@ replaces:
- github.com/open-telemetry/opentelemetry-collector-contrib/receiver/chronyreceiver => ../../receiver/chronyreceiver
- github.com/open-telemetry/opentelemetry-collector-contrib/exporter/parquetexporter => ../../exporter/parquetexporter
- github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver => ../../extension/observer/ecstaskobserver
- github.com/open-telemetry/opentelemetry-collector-contrib/receiver/lokireceiver => ../../receiver/lokireceiver
# see https://github.com/mattn/go-ieproxy/issues/45
- github.com/mattn/go-ieproxy => github.com/mattn/go-ieproxy v0.0.1
- github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest
Expand Down
2 changes: 2 additions & 0 deletions cmd/otelcontribcol/components.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion cmd/otelcontribcol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkametricsreceiver v0.75.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver v0.75.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kubeletstatsreceiver v0.75.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/lokireceiver v0.75.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/memcachedreceiver v0.75.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbatlasreceiver v0.75.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbreceiver v0.75.0
Expand Down Expand Up @@ -292,6 +293,7 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/bmatcuk/doublestar/v4 v4.6.0 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/caio/go-tdigest v3.1.0+incompatible // indirect
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
Expand Down Expand Up @@ -382,7 +384,7 @@ require (
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/gosnmp/gosnmp v1.35.0 // indirect
github.com/grafana/loki/pkg/push v0.0.0-20230127072203-4e8cc8d71928 // indirect
github.com/grafana/loki/pkg/push v0.0.0-20230321110627-5c3d204ebf5d // indirect
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd // indirect
github.com/grobie/gomemcache v0.0.0-20180201122607-1f779c573665 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 // indirect
Expand Down Expand Up @@ -1021,6 +1023,8 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/parqu

replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver => ../../extension/observer/ecstaskobserver

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/lokireceiver => ../../receiver/lokireceiver

replace github.com/mattn/go-ieproxy => github.com/mattn/go-ieproxy v0.0.1

replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest
Expand Down
5 changes: 3 additions & 2 deletions cmd/otelcontribcol/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions cmd/otelcontribcol/receivers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ func TestDefaultReceivers(t *testing.T) {
receiver: "kubeletstats",
skipLifecyle: true, // Requires access to certificates to auth against kubelet
},
{
receiver: "loki",
},
{
receiver: "memcached",
},
Expand Down
6 changes: 5 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkametricsreceiver v0.75.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver v0.75.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kubeletstatsreceiver v0.75.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/lokireceiver v0.75.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/memcachedreceiver v0.75.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbatlasreceiver v0.75.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbreceiver v0.75.0
Expand Down Expand Up @@ -283,6 +284,7 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/bmatcuk/doublestar/v4 v4.6.0 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/caio/go-tdigest v3.1.0+incompatible // indirect
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
Expand Down Expand Up @@ -374,7 +376,7 @@ require (
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/gosnmp/gosnmp v1.35.0 // indirect
github.com/grafana/loki/pkg/push v0.0.0-20230213181200-0394b56368d2 // indirect
github.com/grafana/loki/pkg/push v0.0.0-20230321110627-5c3d204ebf5d // indirect
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd // indirect
github.com/grobie/gomemcache v0.0.0-20180201122607-1f779c573665 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 // indirect
Expand Down Expand Up @@ -946,6 +948,8 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafka

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kubeletstatsreceiver => ./receiver/kubeletstatsreceiver

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/lokireceiver => ./receiver/lokireceiver

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/memcachedreceiver => ./receiver/memcachedreceiver

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbreceiver => ./receiver/mongodbreceiver
Expand Down
5 changes: 3 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions internal/components/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkametricsreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kubeletstatsreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/lokireceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/memcachedreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbatlasreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbreceiver"
Expand Down Expand Up @@ -258,6 +259,7 @@ func Components() (otelcol.Factories, error) {
k8seventsreceiver.NewFactory(),
k8sobjectsreceiver.NewFactory(),
kubeletstatsreceiver.NewFactory(),
lokireceiver.NewFactory(),
memcachedreceiver.NewFactory(),
mongodbatlasreceiver.NewFactory(),
mongodbreceiver.NewFactory(),
Expand Down
12 changes: 6 additions & 6 deletions receiver/lokireceiver/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Loki Receiver

| Status | |
| ------------------------ |---------------|
| Stability | [development] |
| Supported pipeline types | logs |
| Distributions | [contrib] |
| Status | |
| ------------------------ |-----------|
| Stability | [alpha] |
| Supported pipeline types | logs |
| Distributions | [contrib] |

The Loki receiver implements the [Loki push api](https://grafana.com/docs/loki/latest/clients/promtail/#loki-push-api) as specified [here](https://grafana.com/docs/loki/latest/api/#push-log-entries-to-loki).
It allows Promtail instances to specify the open telemetry collector as their lokiAddress.
Expand All @@ -28,5 +28,5 @@ receivers:
use_incoming_timestamp: true
```

[development]:https://github.com/open-telemetry/opentelemetry-collector#development
[alpha]:https://github.com/open-telemetry/opentelemetry-collector#alpha
[contrib]:https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib