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

optional metrics resources #683

Merged
merged 21 commits into from
Jun 1, 2020
Merged

Conversation

vsinghal13
Copy link
Contributor

Description

Fixes #678

Testing performed
  • ci/build.sh
  • Redeploy fluentd and fluentd-events pods
  • Confirm events, logs, and metrics are coming in

Copy link
Contributor

@frankreno frankreno left a comment

Choose a reason for hiding this comment

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

I believe you still need to closing end statement for the if then LGTM

@frankreno
Copy link
Contributor

One thing that was brought up on the issue that we missed, we should do this same conditional rendering for all metrics components. The service, configMap, HPA, etc.

@vsinghal13
Copy link
Contributor Author

Have added the checks for service, configmap and headless-service as well. Skipped it for hpa as it already has the check for fluentd.metrics.autoscaling.enabled and is false by default.

Copy link
Contributor

@perk-sumo perk-sumo left a comment

Choose a reason for hiding this comment

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

I think this should be based on metrics.enabled like it was in the first commit (then changed).
That's because now we'll disable fluentd based on prometheus-operator and that's confusing.
Also to be consistent we should add fluentd.enabled but it doesn't make sense because we use FluentD for everything.
So for logs we have to use logs.enabled. We already have traces.enabled.
I'd suggest to go with metrics.enabled as well.

@perk-sumo perk-sumo added this to the v1.1 milestone May 27, 2020
@sumo-drosiek
Copy link
Contributor

I'm afraid that we cannot disable metrics using prometheus flag, because customers can have their own prometheus and still wants to send metrics. We should go with two flags unfortunately

Copy link
Contributor

@sumo-drosiek sumo-drosiek left a comment

Choose a reason for hiding this comment

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

Need to figure out what to do with metrics without prometheus case

@frankreno
Copy link
Contributor

Good point on existing Prometheus case. It will require two seperate flags.

@perk-sumo
Copy link
Contributor

Please check this out, we should be able to use one flag to rule them all: helm/helm#2111

@@ -1,3 +1,4 @@
{{- if eq .Values.fluentd.metrics.enabled true }}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather use a new flag - sumologic.metrics.enabled like we do for traces.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or actually both sumologic.metrics.enabled and fluentd.metrics.enabled in this case (as this configmap is for fluentd)

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 used this flag as this is part of fluentd itself. and we already have fluentd.events.enabled as compared to traces which is not part of the fluentd section.

Also I feel having both sumologic.metrics.enabled and fluentd.metrics.enabled will not add any functionality as it can be covered by only one.

Thoughts? cc @frankreno @samjsong

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, I'm not sure I understand the usecase for having both sumologic.metrics.enabled and fluentd.metrics.enabled. I can't think of a case where you would want the fluentd pipeline enabled but not the metrics resources, or vice versa. @perk-sumo can you share your reasoning please?

Copy link
Contributor

@sumo-drosiek sumo-drosiek May 29, 2020

Choose a reason for hiding this comment

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

I feel we should have sumologic.metrics.enabled instead of fluentd.metrics.enabled, especially if we gonna replace fluentd in the future, but it's meaningful change, so I would stick to the current flag

Copy link
Contributor

@perk-sumo perk-sumo May 29, 2020

Choose a reason for hiding this comment

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

The idea is to have global flag that is not attached to the underlying implementation so that we (or the user) can switch the tool easily.
There are couple of usecases:

  • disable all the metrics, all the fluentd's, prometheus, configmaps etc - set sumologic.metrics.enabled=false
  • enable all the metrics in the default mode: sumologic.metrics.enabled=true
  • enable metrics, but use own prometheus: sumologic.metrics.enabled=true and prometheus-operator.enabled=false
  • enable metrics, but use own fluentd for tagging: sumologic.metrics.enabled=true and fluentd.metrics.enabled=false
  • enable metrics, but use experimental OTC for that: sumologic.metrics.enabled=true and fluentd.metrics.enabled=false, prometheus-operator.enabled=false, otelcol.metrics.enabled=true

Copy link
Contributor

Choose a reason for hiding this comment

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

What @perk-sumo suggestion seems to be the cleanest approach.

deploy/helm/sumologic/requirements.yaml Outdated Show resolved Hide resolved
@vsinghal13 vsinghal13 mentioned this pull request May 29, 2020
4 tasks
@@ -6,7 +6,7 @@ dependencies:
- name: prometheus-operator
version: 8.13.8
repository: https://kubernetes-charts.storage.googleapis.com/
condition: prometheus-operator.enabled
condition: sumologic.metrics.enabled,prometheus-operator.enabled
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 Please add this into the fluent-bit as well:
condition: sumologic.logs.enabled,fluent-bit.enabled

Copy link
Contributor

@perk-sumo perk-sumo left a comment

Choose a reason for hiding this comment

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

Thanks for the redo :)
I've left couple of suggestions but overall it's heading in the good direction 👍

Copy link
Contributor

@sumo-drosiek sumo-drosiek left a comment

Choose a reason for hiding this comment

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

LGTM, except @perk-sumo findings

// @perk-sumo suggestions are awesome :O
// Is it the new feature?

Copy link
Contributor

@frankreno frankreno left a comment

Choose a reason for hiding this comment

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

LGTM. Same comments as @perk-sumo.

vsinghal13 and others added 3 commits June 1, 2020 09:00
Co-authored-by: Marcin Stozek <58700054+perk-sumo@users.noreply.github.com>
@vsinghal13 vsinghal13 requested a review from perk-sumo June 1, 2020 16:15
Copy link
Contributor

@perk-sumo perk-sumo left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@perk-sumo perk-sumo merged commit 5ce35d6 into master Jun 1, 2020
@perk-sumo perk-sumo deleted the vsinghal-optional-metrics-resources branch June 1, 2020 16:23
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.

Make it optional to collect kubernetes metrics
5 participants