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

Issue #59: Display the connector variables #61

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

CherfaElyes
Copy link
Contributor

  • Added a variables section under the prerequisites in the connectors pages to display the connector template variables, their description & their default value if available.
  • Updated MetricsHub example content producer to add variables configuration example.
  • Tested on metricshub-doc.

Tests

Default connector variables specified.

image

Default connector variables not specified (variables are present).

image

MetricsHub.yaml example

image

* Added a `variables` section under the `prerequisites` in the connectors pages to display the connector template variables, their description & their default value if available.
* Tested on metricshub-doc.
* Updated MetricsHub example content producer to add variables configuration example.
* Tested the results
@CherfaElyes CherfaElyes self-assigned this Sep 27, 2024
@CherfaElyes CherfaElyes linked an issue Sep 27, 2024 that may be closed by this pull request
* Resolved merge conflict.
@bertysentry
Copy link
Member

I would simplify the listing of variables like below:

Variables:

  • matchCommand: Regular expression that command line of the process must match with (default: .*)
  • matchName: Regular expression that the process name must match with (default: .*)

So the "template" is like:

<li> <code>VARNAME</code>: VARDESCRIPTION (default: <code>DEFAULTVALUE</code>)

Description and default value should be displayed in the doc only if they are specified, like below:

  • matchName
  • matchName: Regular expression that the process name must match with
  • matchName (default: .*)

@bertysentry
Copy link
Member

Now an interesting question: how do we specify variable values for a connector through the CLI? 😅

@NassimBtk
Copy link
Member

NassimBtk commented Sep 27, 2024

There is a plan for this @bertysentry sentrysoftware/metricshub#357... indeed, we still require a spec.

final String variableRegex = "\\$\\{var::(.*?)\\}";
final Set<String> variables = new HashSet<>();

final Pattern pattern = Pattern.compile(variableRegex);
Copy link
Member

Choose a reason for hiding this comment

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

Create a constant please.

@@ -0,0 +1,42 @@
package org.sentrysoftware.maven.metricshub.connector.producer.model.common;

import lombok.AllArgsConstructor;
Copy link
Member

Choose a reason for hiding this comment

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

Should be under the ╱╲╱╲╱╲ header comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display the connector variables
3 participants