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

Add an option to expose Prometheus metrics via http/s in the forwarder-vpp #1137

Merged

Conversation

bszirtes
Copy link
Contributor

Description

Added a section in the main for initializing Prometheus and extended the config with the required variables.

Issue link

networkservicemesh/sdk#1652

How Has This Been Tested?

  • Added unit testing to cover
  • Tested manually
  • Tested by integration testing
  • Have not tested

Types of changes

  • Bug fix
  • New functionality
  • Documentation
  • Refactoring
  • CI

main.go Outdated
Comment on lines 156 to 164
collectorAddress := cfg.OpenTelemetryEndpoint
spanExporter := opentelemetry.InitSpanExporter(ctx, collectorAddress)
metricExporter := opentelemetry.InitPrometheusMetricExporter(ctx)
o := opentelemetry.Init(ctx, spanExporter, metricExporter, cfg.Name)
defer func() {
if err = o.Close(); err != nil {
log.FromContext(ctx).Error(err.Error())
}
}()
Copy link
Member

Choose a reason for hiding this comment

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

Curious. Why do we need to use opentemeltry in the prometheus branch?

@bszirtes bszirtes force-pushed the prometheus-without-otel branch 2 times, most recently from b95ca3a to e24ec63 Compare August 16, 2024 11:53
@denis-tingaikin
Copy link
Member

Could you please rebase the branch to the latest sdk?

@bszirtes bszirtes force-pushed the prometheus-without-otel branch 6 times, most recently from 55cc797 to 402950b Compare August 21, 2024 09:57
@bszirtes
Copy link
Contributor Author

Hi @denis-tingaikin,

I have rebased the branch to the latest sdk.

Copy link
Member

@denis-tingaikin denis-tingaikin left a comment

Choose a reason for hiding this comment

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

Added one comment, in general looks good.

Comment on lines 52 to 53
PrometheusIP string `default:"" desc:"Prometheus IP address" split_words:"true"`
PrometheusPort uint16 `default:"8081" desc:"Prometheus port to use" split_words:"true"`
Copy link
Member

Choose a reason for hiding this comment

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

Can be combined to PrometheusListenOn by analogy with ListenOn, PprofListenOn.

…r-vpp

Signed-off-by: Botond Szirtes <botond.szirtes@est.tech>
@bszirtes
Copy link
Contributor Author

Hi @denis-tingaikin,

Thanks! I've made the modification as you recommended.

@denis-tingaikin denis-tingaikin merged commit bed7f0f into networkservicemesh:main Aug 27, 2024
13 checks passed
nsmbot pushed a commit to networkservicemesh/deployments-k8s that referenced this pull request Aug 27, 2024
…d-forwarder-vpp@main

PR link: networkservicemesh/cmd-forwarder-vpp#1137

Commit: bed7f0f
Author: Botond Szirtes
Date: 2024-08-27 14:14:23 +0200
Message:
  - Add an option to expose Prometheus metrics via http/s in the forwarder-vpp (#1137)
Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot added a commit to networkservicemesh/deployments-k8s that referenced this pull request Aug 27, 2024
…d-forwarder-vpp@main (#12270)

PR link: networkservicemesh/cmd-forwarder-vpp#1137

Commit: bed7f0f
Author: Botond Szirtes
Date: 2024-08-27 14:14:23 +0200
Message:
  - Add an option to expose Prometheus metrics via http/s in the forwarder-vpp (#1137)

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
Co-authored-by: NSMBot <nsmbot@networkservicmesh.io>
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