ofek opened a new pull request #4858:
URL: https://github.com/apache/nifi/pull/4858


   Remove low-value default tags
   
   Send processor name as tag instead of as part of metric name
   
   Thank you for submitting a contribution to Apache NiFi.
   
   Please provide a short description of the PR here:
   
   #### Description of PR
   
   This continues #4637, copying the description:
   
   This resolves a few pain points related to the `DataDogReportingTask` that 
we've been hearing from customers, tracked in the following tickets:
   
   * [NIFI-4713](https://issues.apache.org/jira/browse/NIFI-4713) - Processor 
name shouldn't be embedded into metric name
   * [NIFI-5535](https://issues.apache.org/jira/browse/NIFI-5535) - Reporting 
task generates too many custom metrics (due to metric names and tags)
   
   This PR contains the following changes (unchecked items still TODO):
   
   * [x]  Remove all tags from metrics except from `env` (for all metrics) and 
`processor` (for processor metrics only).
   * [x]  Drop the processor name from the name of metrics (eg 
`nifi.exampleProcessor.FlowFilesReceivedLast5Minutes` -> 
`nifi.FlowFilesReceivedLast5Minutes`, and `nifi.flow.ActiveThreads` -> 
`nifi.ActiveThreads`) and submit it as a tag
   
   These changes are so that the `DataDogReporting` task plays better with 
Datadog, in particular:
   
   * Allow users to use native functionality allowed by tagging, such as 
filtering, grouping, etc.
   * Remove drastically the amount of `metric x tags` possible values, in order 
to reduce the number of custom metrics this reporting task generates. Now 
number of custom metrics is `23 + 6 * num_processors`, instead of potentially 
thousands or more.
   
   **Note**: a natural follow-up to this PR would be to implement a 
configuration mechanism so that users have better control on what groups of 
metrics they'd like to collect. These groups would probably be: `processors`, 
`connection_statuses`, `input_port_statuses`, `output_port_statuses`, `jvm`, 
and `data_flow`. This has been requested in both NIFI-4713 and NIFI-5535, and 
would allow users to reduce even more the number of custom metrics so that only 
what they need is pushed to Datadog. This is completely orthogonal to what this 
PR focuses on: it won't require any changes to the metric names, values, or 
tags. So I'm keeping this for a follow-up PR.
   
   ### For all changes:
   * [x]  Is there a JIRA ticket associated with this PR? Is it referenced
     in the commit message?
   * [x]  Does your PR title start with **NIFI-XXXX** where XXXX is the JIRA 
number you are trying to resolve? Pay particular attention to the hyphen "-" 
character. (**Note**: this is related to two JIRA tickets so I've included both 
in the commit message and PR title.)
   * [ ]  Has your PR been rebased against the latest commit within the target 
branch (typically `main`)?
   * [x]  Is your initial contribution a single, squashed commit? _Additional 
commits in response to PR reviewer feedback should be made on this branch and 
pushed to allow change tracking. Do not `squash` or use `--force` when pushing 
to allow for clean monitoring of changes._
   
   ### For code changes:
   * [ ]  Have you ensured that the full suite of tests is executed via `mvn 
-Pcontrib-check clean install` at the root `nifi` folder?
   * [ ]  Have you written or updated unit tests to verify your changes?
   * [x]  Have you verified that the full build is successful on JDK 8?
   * [ ]  Have you verified that the full build is successful on JDK 11?
   * [x]  ~If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)?~ - Not applicable
   * [x]  ~If applicable, have you updated the `LICENSE` file, including the 
main `LICENSE` file under `nifi-assembly`?~ - Not applicable
   * [x]  ~If applicable, have you updated the `NOTICE` file, including the 
main `NOTICE` file found under `nifi-assembly`?~ - Not applicable
   * [x]  ~If adding new Properties, have you added `.displayName` in addition 
to .name (programmatic access) for each of the new properties?~ - Not applicable
   
   ### For documentation related changes:
   * [x]  ~Have you ensured that format looks appropriate for the output in 
which it is rendered?~ - Not applicable
   
   ### Note:
   Please ensure that once the PR is submitted, you check GitHub Actions CI for 
build issues and submit an update to your PR as soon as possible.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to