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

[Prometheus Sample App] Adding features LabelCount, DatapointCount, Norm Dist, and K8s cluster config #11

Merged
merged 2 commits into from
Dec 17, 2021

Conversation

PaurushGarg
Copy link
Contributor

@PaurushGarg PaurushGarg commented Dec 16, 2021

Added following features:

  • Configurable constant labels generation
  • Configurable multiple datapoints generation
  • Introduced normal distribution for summary metric values.
  • Created example deployment file to simulate multiple host/endpoints scrapping environment for OTEL Collector using Prometheus Sample App
  • Updated Readme to run cluster on Kubernetes and on Amazon EKS.

Issue: 10

cc @alolita @Aneurysm9

Copy link
Contributor

@alolita alolita left a comment

Choose a reason for hiding this comment

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

Paurush - pl add more inline comments in the code to have a high-level overview of the functionality. Also - would be good to have a changelog of key changes you've made - could be a list of commits / PRs.

README.md Outdated
- Docker
- Docker Image Prometheus-Sample-App
- Minikube
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Minikube
- A Kubernetes cluster

This should work on any k8s cluster, not just minikube.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Aneurysm9 thanks. I have updated.

README.md Outdated
- Minikube

### Deployment on Kubernetes:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
### Deployment on Kubernetes:
### Deployment on Minikube:

EKS is Kubernetes, too. This has some detail specific to minikube, so call that out here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Aneurysm9 thanks. I have updated.

README.md Outdated
- Start Minikube dashboard
```bash
$ minikube dashboard
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the dashboard need to be running?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Aneurysm9 thanks. no its not a requirement. So I have removed the step.

README.md Outdated
```

Currently, OTEL Collector is configured with Logging exporter. Since all 5 replica Prometheus-Sample-App pods will produce identical metric names and labels, so Prometheus Exporter should be configured with additional details to ensure distinct metrics identity.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any information we can include here regarding what sort of additional details need to be included and how to include them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Aneurysm9 I am unsure right now what can be done, my understanding is to generate unique source labels through configuration. But I am not entirely sure. So I have updated the comment.

Comment on lines 14 to 17
var (
normDomain = flag.Float64("normal.domain", 0.0002, "The domain for the normal distribution.")
normMean = flag.Float64("normal.mean", 0.00001, "The mean for the normal distribution.")
)
Copy link
Contributor

Choose a reason for hiding this comment

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

These should probably go in metrics_cli.go. They're CLI flags so the seem a better fit there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Aneurysm9 thanks. I have updated.

Comment on lines 59 to 64
lowerBound := math.Mod(rand.Float64(), 1)
increment := math.Mod(rand.Float64(), 0.05)
labels := datapointLabels(i, mc.labelKeys, mc.labelValues)
for j := lowerBound; j < 1; j += increment {
mc.histograms[idx].With(labels).Observe(j)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this also use a random distribution rather than incremental observations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Aneurysm9 thanks. I have updated.

Namespace: namespace,
Name: fmt.Sprintf("summary%v", idx),
Help: "This is my summary",
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
Copy link
Contributor

Choose a reason for hiding this comment

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

What does this change will do?

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 have reversed this change. I was trying different quantile ranges, so left them there. I have reversed it now.

- name: otelcol
args:
- --config=/conf/collector.yaml
image: otel/opentelemetry-collector:0.18.0
Copy link
Contributor

Choose a reason for hiding this comment

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

This is ancient, isn't it? Can this be updated to a newer collector image?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Aneurysm9 thanks. I have updated.

@PaurushGarg
Copy link
Contributor Author

Paurush - pl add more inline comments in the code to have a high-level overview of the functionality. Also - would be good to have a changelog of key changes you've made - could be a list of commits / PRs.

Thanks. I have updated the comments. I included the list of changes in the issue(#10) and PR description. I couldnt find a changelog file in this project.

@Aneurysm9 Aneurysm9 merged commit cc034f4 into master Dec 17, 2021
@PaurushGarg PaurushGarg deleted the prom-sample-app-issue-10 branch December 18, 2021 05:14
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.

3 participants