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

fix: set GO usage environment variables from resource limits #42

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

rogercoll
Copy link
Contributor

No description provided.

@rogercoll rogercoll requested a review from lahsivjar October 31, 2024 14:23
@rogercoll
Copy link
Contributor Author

All variables remain and GOMAXPROCS value is rounded up:

Environment:
      OTEL_K8S_NODE_NAME:   (v1:spec.nodeName)
      OTEL_K8S_NODE_IP:     (v1:status.hostIP)
      OTEL_K8S_NAMESPACE:  opentelemetry-operator-system (v1:metadata.namespace)
      OTEL_K8S_POD_NAME:   opentelemetry-kube-stack-daemon-collector-9brfc (v1:metadata.name)
      OTEL_K8S_POD_IP:      (v1:status.podIP)
      ELASTIC_AGENT_OTEL:  true
      GOMEMLIMIT:          1025MiB
      ELASTIC_API_KEY:     <set to the key 'elastic_api_key' in secret 'elastic-secret-otel'>   Optional: false
      ELASTIC_ENDPOINT:    <set to the key 'elastic_endpoint' in secret 'elastic-secret-otel'>  Optional: false
      GOMAXPROCS:          2 (limits.cpu)

Copy link
Contributor

@lahsivjar lahsivjar left a comment

Choose a reason for hiding this comment

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

LGTM! One nit regarding hard coded mem limit.

resourceFieldRef:
resource: limits.cpu
- name: GOMEMLIMIT
value: "1025MiB"
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can write a script to keep this 90% (or lower if we want to go lower) of the memory limit? Will be a bit easier to manage and update in future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely, that would be a better setting. As discussed, we can help with open-telemetry/opentelemetry-collector-contrib#30289 moving it forward.

@rogercoll rogercoll merged commit 6c7e5d8 into elastic:main Oct 31, 2024
1 check passed
@rogercoll rogercoll deleted the align_go_k8s_resources branch October 31, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants