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 Nginx Ingress Controller Otel integration #11285

Merged
merged 14 commits into from
Oct 28, 2024

Conversation

rogercoll
Copy link
Contributor

@rogercoll rogercoll commented Oct 1, 2024

Proposed commit message

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

Author's Checklist

  • [ ]

How to test this PR locally

Unit testing

  1. Create a fake k8s pods logs path, for example:
$ mkdir -p /tmp/var/log/pods/kube-system_kube-controller-kind-control-plane_49cc7c1fd3702c40b2686ea7486091d6/kube-controller/
  1. Modify the configuration to read from the /tmp directory instead:
  filelog:
    include_file_path: true
    include: [/tmp/var/log/pods/*/*/*.log]
  1. Update your Elasticsearch endpoint/api variables
  2. Append some faked Nginx Ingress Controller access or error logs to the log file, for example:
$ echo '2024-10-07T07:48:23.966071760Z stdout F 81.2.69.140 - - [25/Jun/2024:15:16:56 +0000] "POST /flagservice/flagd.evaluation.v1.Service/EventStream HTTP/1.1" 400 47 "http://1.2.3.4.5/" "Mozilla/5.0 (X11; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 522 12.065 [default-my-otel-demo-frontendproxy-8080] [] 10.80.0.67:8080 47 12.065 200 797ee0551e7c23b541757e13b5b6b4e6'  >> /tmp/var/log/pods/kube-system_kube-controller-kind-control-plane_49cc7c1fd3702c40b2686ea7486091d6/kube-controller/1.log

$ echo '2024-10-07T07:48:23.137838690Z stdout F F0930 10:39:59.102914 8 config.go:659] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.' >> /tmp/var/log/pods/kube-system_kube-controller-kind-control-plane_49cc7c1fd3702c40b2686ea7486091d6/kube-controller/1.log

Related issues

Screenshots

@andrewkroh andrewkroh added the New Integration Issue or pull request for creating a new integration package. label Oct 1, 2024
@rogercoll rogercoll force-pushed the add_nginx_ingess_otel branch from dd8173f to 063dded Compare October 4, 2024 08:22
@rogercoll rogercoll force-pushed the add_nginx_ingess_otel branch from 8dc895f to 27542ab Compare October 4, 2024 09:30
@rogercoll
Copy link
Contributor Author

Is there a way to remove the "Add Nginx Ingress Controller OpenTelemetry Logs integration" button? (deployment mode)

@rogercoll rogercoll requested a review from ChrsMark October 7, 2024 09:58
@rogercoll rogercoll marked this pull request as ready for review October 7, 2024 09:58
@@ -288,6 +288,7 @@
/packages/network_traffic @elastic/sec-linux-platform
/packages/nginx @elastic/obs-infraobs-integrations
/packages/nginx_ingress_controller @elastic/obs-cloudnative-monitoring
/packages/nginx_ingress_controller_otel @elastic/obs-infraobs-integrations
Copy link
Member

Choose a reason for hiding this comment

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

This is a bit fuzzy. The non-otel integration is elastic/obs-cloudnative-monitoring but this is obs-infraobs-integrations?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Adding @bturquet for any suggestions, I am ok with either.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am ok with both too. If it is helpful for you, I could additionally add myself as a codowner until Otel integrations become more stable.

packages/nginx_ingress_controller_otel/changelog.yml Outdated Show resolved Hide resolved
packages/nginx_ingress_controller_otel/docs/README.md Outdated Show resolved Hide resolved
packages/nginx_ingress_controller_otel/docs/README.md Outdated Show resolved Hide resolved
@ishleenk17
Copy link
Contributor

ishleenk17 commented Oct 15, 2024

@rogercoll : It has build failures:

  | 1. item [collector-config.yaml] is not allowed in folder [/opt/buildkite-agent/builds/bk-agent-prod-gcp-1728919549244574433/elastic/integrations/packages/nginx_ingress_controller_otel]
  | 2. item [search] is not allowed in folder [/opt/buildkite-agent/builds/bk-agent-prod-gcp-1728919549244574433/elastic/integrations/packages/nginx_ingress_controller_otel/kibana]

I think since elastic package doesn't expect collector-config.yaml to be present. It is throwing an error. We will have to see how we can place this collector config. Or we should change the elastic package spec to have this addition.

Please check for the 2nd error as well.

@elasticmachine
Copy link

💚 Build Succeeded

History

@rogercoll rogercoll requested a review from ChrsMark October 24, 2024 10:58
Copy link
Member

@ChrsMark ChrsMark left a comment

Choose a reason for hiding this comment

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

LGTM

@rogercoll
Copy link
Contributor Author

@rogercoll : It has build failures:

| 1. item [collector-config.yaml] is not allowed in folder [/opt/buildkite-agent/builds/bk-agent-prod-gcp-1728919549244574433/elastic/integrations/packages/nginx_ingress_controller_otel] | 2. item [search] is not allowed in folder [/opt/buildkite-agent/builds/bk-agent-prod-gcp-1728919549244574433/elastic/integrations/packages/nginx_ingress_controller_otel/kibana]

I think since elastic package doesn't expect collector-config.yaml to be present. It is throwing an error. We will have to see how we can place this collector config. Or we should change the elastic package spec to have this addition.

Please check for the 2nd error as well.

Thanks @ishleenk17, I think those were fixed on the latest comment

@ishleenk17
Copy link
Contributor

Looks good!
Curious, how did the search issue get resolved? Are we no longer having the saved search in the dashboard ?

@ishleenk17
Copy link
Contributor

Also, for now I see we are moving the configuration to the README.
It would make the README look quite big. Hope that is discussed before releasing this Integration.
As soon as its merged it will be out for usage to the customers in Tech Preview.
cc: @AlexanderWert

@rogercoll
Copy link
Contributor Author

Curious, how did the search issue get resolved? Are we no longer having the saved search in the dashboard ?

Correct, I was not able to add the search object, but the ES/QL visualization alternative seems to work fine (similar results).

Copy link
Contributor

@ishleenk17 ishleenk17 left a comment

Choose a reason for hiding this comment

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

Looks good!

@rogercoll rogercoll merged commit 974666b into elastic:main Oct 28, 2024
5 checks passed
@rogercoll rogercoll deleted the add_nginx_ingess_otel branch October 28, 2024 14:03
@elastic-vault-github-plugin-prod

Package nginx_ingress_controller_otel - 0.0.1 containing this change is available at https://epr.elastic.co/search?package=nginx_ingress_controller_otel

@andrewkroh andrewkroh added Integration:nginx_ingress_controller_otel Nginx Ingress Controller OpenTelemetry Logs Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations] labels Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Integration:nginx_ingress_controller_otel Nginx Ingress Controller OpenTelemetry Logs New Integration Issue or pull request for creating a new integration package. Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants