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

feat: add OtelCol as alternative logs metadata provider #1697

Merged
merged 37 commits into from Sep 10, 2021

Conversation

sumo-drosiek
Copy link
Contributor

Description

Add otelcol support for logs pipeline


Testing performed
  • Redeploy fluentd and fluentd-events pods
  • Confirm events, logs, and metrics are coming in

@sumo-drosiek sumo-drosiek requested a review from a team as a code owner July 16, 2021 09:25
@sumo-drosiek sumo-drosiek marked this pull request as draft July 16, 2021 09:25
@sumo-drosiek sumo-drosiek force-pushed the drosiek-otc branch 2 times, most recently from 5a151fe to afad9f3 Compare July 20, 2021 06:54
@sumo-drosiek sumo-drosiek marked this pull request as ready for review August 5, 2021 14:00
@sumo-drosiek sumo-drosiek changed the title WIP: support otelcol for logs pipeline support otelcol for logs pipeline Aug 6, 2021
Copy link
Contributor

@kkujawa-sumo kkujawa-sumo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logs are coming to Sumo, hpa works.
I think that only description of new parameters in values.yaml needs to be added to documentation.

Test with following values.yaml:

sumologic:
  accessId: *******
  accessKey: ****************
  endpoint: ""
  clusterName: "kubernetesvagrant"
  logs:
    provider: otelcol

logs:
  ## Option to turn autoscaling on for logs and specify params for HPA.
  ## Autoscaling needs metrics-server to access cpu metrics.
  autoscaling:
    enabled: true
    minReplicas: 3
    maxReplicas: 10
    targetCPUUtilizationPercentage: 50
    # targetMemoryUtilizationPercentage: 50

metrics-server:
  ## Set the enabled flag to true for enabling metrics-server.
  ## This is required before enabling fluentd autoscaling unless you have an existing metrics-server in the cluster.
  enabled: true

@sumo-drosiek
Copy link
Contributor Author

sumo-drosiek commented Sep 7, 2021

Add change analogic to 55793c6

actions:
- action: extract
key: fluent.tag
pattern: ^containers\.var\.log\.pods\.(?P<namespace>[^_]+)_(?P<pod_name>[^_]+)_(?P<uid>[a-f0-9\-]{36})\.(?P<container_name>[^\._]+)\.(?P<run_id>\d+)\.log$
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update to support /var/log/containers to avoid changing fluent-bit config

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and update metadata enrichment to enrich using pod name and namespace name

Comment on lines 2505 to 2751
pod_association:
- from: resource_attribute
name: k8s.pod.uid ## Source processor adds Sumo Logic related metadata
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to

pod_association:
- from: build_hostname

k8s.pod.name and k8s.namespace.name resource attributes are required

@sumo-drosiek
Copy link
Contributor Author

Update README.md
It can be good to review #1702 comments as well

deploy/helm/sumologic/values.yaml Outdated Show resolved Hide resolved
deploy/helm/sumologic/values.yaml Outdated Show resolved Hide resolved
deploy/helm/sumologic/values.yaml Outdated Show resolved Hide resolved
@sumo-drosiek
Copy link
Contributor Author

#1702 (comment)

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
…lpers

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
pmalek and others added 6 commits September 8, 2021 10:03
It is not going to be used, as the OtelCol metadata provider
will be using the same `sumologic.endpoint` property as Fluentd.
It is not going to be used. OtelCol will be using the same endpoint
as Fluentd is using now, as opposed to the new open endpoint,
so the extension is not needed.
{{ toYaml .Values.logs.statefulset.podAnnotations | indent 8 }}
{{- end }}
labels:
app: {{ template "sumologic.labels.app.logs.pod" . }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also needs to be changed to take into account the provider. As of now I'm seeing

Name:         collection-sumologic-otelcol-logs-0
Namespace:    sumologic
Priority:     0
Node:         sumologic-kubernetes-collection/10.0.2.15
Start Time:   Wed, 08 Sep 2021 12:08:51 +0200
Labels:       app=collection-sumologic-fluentd-logs
              chart=sumologic-2.2.0-dev.0
              controller-revision-hash=collection-sumologic-otelcol-logs-56cf654b8
              heritage=Helm
              release=collection
              statefulset.kubernetes.io/pod-name=collection-sumologic-otelcol-logs-0
...

These templates are currently only used by OtelCol and not by Fluentd,
so the additional logic is not needed at the moment.
@github-actions github-actions bot added the documentation documentation label Sep 8, 2021
@andrzej-stencel andrzej-stencel changed the title support otelcol for logs pipeline feat: add OtelCol as alternative logs metadata provider Sep 10, 2021
@andrzej-stencel andrzej-stencel merged commit e1f8406 into main Sep 10, 2021
@andrzej-stencel andrzej-stencel deleted the drosiek-otc branch September 10, 2021 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants