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

feat(integrationBehaviour): the integration accept a new parameter to… #63

Merged
merged 3 commits into from
Aug 24, 2020

Conversation

paologallinaharbur
Copy link
Member

@paologallinaharbur paologallinaharbur commented Aug 13, 2020

The nri-prometheus integration now accepts new config/parameters:

  • StandAlone in the config file permits changing the whole behaviour of the integration
  • ConfigPath argument allows to set a new path for the configuration file used by Viper (previously hardcoded). In particular that feature is going to be used by the agent when passing the path to a tmp file generated from the integration config file.

By default the behaviour is the old one, however if standAlone is set to True a new behaviour kicks in.

Moreover the Viper version has been bumped up since the file passed by the agent is extensionless and only a newer version of Viper supports it and go mod tidy has been run

Old behaviour:

  • nri-prometheus is capable to run as a standAlone integration, it manages automatically scraping metrics, processing them and sending data to the NewRelic.
    The process does not terminate after sending the data, therefore once defined the targets they get scraped periodically and the result is sent
    Moreover the integration is exposing telemetry data through a prometheus endpoint.

New behaviour

  • Currently it is just a stub (printing "New Behaviour" and exiting) in order to allow reviewing the change of the main in an easier way.
    The new behaviour would transform this integration making it more similar to a onHost integration, therefore it will focus merely on scraping data and processing it. The execution and sending the data will be managed by the agent.

    It will output the data on stdOut and exit leveraging the agent to send data and to perform auto-discovery

@CLAassistant
Copy link

CLAassistant commented Aug 13, 2020

CLA assistant check
All committers have signed the CLA.

@alejandrodnm
Copy link
Contributor

alejandrodnm commented Aug 13, 2020

Hi @paologallinaharbur can you please explain the old and new behaviours in the PR description and why it's needed

@paologallinaharbur paologallinaharbur force-pushed the pgallina/integrationBehaviour branch from 26970b1 to 91b66e7 Compare August 13, 2020 08:09
Copy link

@davidbrota davidbrota left a comment

Choose a reason for hiding this comment

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

I've left some comments.

cmd/nri-prometheus/config.go Outdated Show resolved Hide resolved
configs/nri-prometheus-config.yml.sample Show resolved Hide resolved
configs/nri-prometheus-config.yml.sample Outdated Show resolved Hide resolved
cmd/nri-prometheus/config.go Outdated Show resolved Hide resolved
configs/nri-prometheus-config.yml.sample Outdated Show resolved Hide resolved
Copy link

@davidbrota davidbrota left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -0,0 +1,27 @@
integrations:
- name: nri-prometheus
inventory_source: integration/com.newrelic.prometheus
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we could remove this and use the default instead. inventory_source is set by default as integration/nri-prometheus . docs .

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know why it was set explicitly here, @gsanchezgavier? Removing it here and using the default will change the actual name.

Copy link
Contributor

Choose a reason for hiding this comment

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

no i don't, but inventory is not being used afaik here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm just keeping it like this for now, and discuss this with Paolo when he's back. We'll not do a release with it yet, anyway.

Copy link

@morecar morecar left a comment

Choose a reason for hiding this comment

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

koolio

@jorik jorik merged commit 1b3f3fb into main Aug 24, 2020
@jorik jorik deleted the pgallina/integrationBehaviour branch August 24, 2020 15:35
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.

9 participants