Comments (5)
This SignalFxMonitor CRD you are proposing would be manually updated by a cluster admin and would basically be the equivalent of a single entry under monitors: in the agent.yaml config?
Yep that was my thinking. It would mean our dev teams could keep a SignalFxMonitor
object alongside their Deployment
definitions and automatically get monitoring. Granted the same is possible with annotations, it is just for neatness purposes that I wanted to do it as a separate CRD.
Also note that you don't have to do everything in the annotations on the resources, you can put some of "boilerplate" config in the agent main ConfigMap and use discovery rules and then put more specific things in annotations and the agent will merge them all together.
This goes a long way to solving my problems. Do you have an example to hand? Do I just supply a monitors
entry without a discoverRule
to do this? All of our services are currently inheriting a single YAML anchor in the main agent.yaml
to make life easy, so if I can re-use that via annotations then it's problem solved.
Also keep in mind that you can map multiple ConfigMaps into the agent container on K8s (by adding them to the DaemonSet) and reference them in the main agent.yaml with the {"#from": "file:/etc/signalfx/other-config.yaml"} remote config syntax. The agent will dynamically reload on changes to those files and would be roughly equivalent to what you are proposing with CRDs, if I am understanding you correctly.
This sounds like it would make loading multiple SignalFxMonitor
CRDs easier. Do these auto-reload correctly when the contents of the #from
file is changed?
from signalfx-agent.
This SignalFxMonitor
CRD you are proposing would be manually updated by a cluster admin and would basically be the equivalent of a single entry under monitors:
in the agent.yaml config?
Also note that you don't have to do everything in the annotations on the resources, you can put some of "boilerplate" config in the agent main ConfigMap and use discovery rules and then put more specific things in annotations and the agent will merge them all together.
Also keep in mind that you can map multiple ConfigMaps into the agent container on K8s (by adding them to the DaemonSet) and reference them in the main agent.yaml with the {"#from": "file:/etc/signalfx/other-config.yaml"}
remote config syntax. The agent will dynamically reload on changes to those files and would be roughly equivalent to what you are proposing with CRDs, if I am understanding you correctly.
from signalfx-agent.
Do I just supply a
monitors
entry without adiscoverRule
to do this?
No, you must supply a discoveryRule that matches the endpoint specified by the annotation config on the K8s resource. I added an integration test that shows this and proves that it works: https://github.com/signalfx/signalfx-agent/pull/1088/files. Let me know if that is not clear.
Do these auto-reload correctly when the contents of the #from file is changed?
Yes, anything specified with the #from
refs gets watched and changes will cause a reload automatically in the agent. You can even specify a glob of multiple files with {"#from": "file:/etc/signalfx/monitors/*.yaml"}
for example and it will watch all of them for changes. ConfigMaps
support multiple files specified in a single instance as well.
Let me know if there are any pain points that these two things cannot solve. I would rather not add a CRD if it is basically just a glorified alternative to ConfigMaps that is nearly functionally equivalent.
from signalfx-agent.
Interesting 🤔. I do understand your point about keeping it simple... I guess I just prefer being able to kubectl get signalfxmonitor
😛 from an operator perspective.
At the moment we have discoveryRule
entries like so:
- discoveryRule: container_image =~ "app-1" && container_port == "9999"
- discoveryRule: container_image =~ "app-2" && container_port == "9999"
- discoveryRule: container_image =~ "app-3" && container_port == "9999"
- discoveryRule: container_image =~ "app-4" && container_port == "9999"
Which means pre-defining our apps in the agent.yaml
anyway if we want to use the merge functionality.
I guess the best way to configure it would be to set a generic discoveryRule
in agent.yaml
that is matches all relevant Pods
.
Would something like this work:
Pod
apiVersion: v1
kind: Pod
metadata:
labels:
agent.signalfx.com/scrape: "true"
agent.yaml
monitors:
- type: prometheus-exporter
discoveryRule: Get(container_labels, "agent.signalfx.com/scrape") == "true" && container_port == "9999"
.... more config here ......
from signalfx-agent.
Yes, you can absolutely do a "generic" discoveryRule that applies to a bunch of endpoints that should share common configuration. Each one will get its own monitor instance and the merging will be done separately for each endpoint discovered.
I get the desire for a custom resource that makes things explicit, we'll take it into consideration.
Going to close for now but if you have any more questions/concerns about this reopen and let us know!
from signalfx-agent.
Related Issues (20)
- how to get the sfx metric details and its complete description. HOT 3
- SignalFx agent installation on proxy based server HOT 3
- package doesn't include libnss_resolve HOT 2
- From where we can download the signalfx agent latest rpm file to install.
- Signalfx agent is unable to pick the proxy configurations
- how to run a powershell script from exec plugin HOT 2
- Deprecation notice doesn't make sense to me HOT 2
- Issue regarding metric sf.org.num.mutingactive HOT 1
- Error: " Unable to collect username for process " from SignalFx agent HOT 1
- Signalfx agent making IMDSv1 request HOT 1
- StatsD parser doesn't handle tag values that contain colons
- API to get the list of CI reporting to console from any cloud native like EC2 instances HOT 1
- logLevel is not working in signalfx helm chart HOT 1
- Agent Occasionally Drops HTTP POST Connections HOT 1
- Helm chart version 1.9.4 does not work with App version 5.21.0 (error retrieving resource lock during leaderelection) HOT 2
- What is the upcoming release schedule? HOT 2
- Monitor never create with discoveryRule HOT 2
- metrics monitor `container_cpu_utilization` is seconds not percentages HOT 2
- Bump issue in k8s deployment files HOT 1
- check_links action should ignore SQL link HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from signalfx-agent.