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

[Fix #3486] Add input param counter #3489

Merged
merged 2 commits into from
May 3, 2024
Merged

Conversation

fjtirado
Copy link
Contributor

@fjtirado fjtirado commented Apr 29, 2024

Fix #3486
Name of the new counters is sonataflow_input_parameters_counter
Array input parameters will be stored by default as json strings
This can be changed by setting kie.monitoring.sonataflow.arrays.store property value to MULTI_PARAM, in which case arrays will be stored individually with keys of the forms arrray_key_name[array_item_number]

Lets illustrate that with an example
If input is

{
    "numbers": [
        {
            "x": 12321,
            "y": 3
        },
        {
            "x": 18,
            "y": 3232323
        }
    ]
}

by default it will be stored as
"param_name":"numbers","param_value":"[{\"x\":12321,\"y\":3},{\"x\":18,\"y\":3232323}]"

But if application.properties contains
kie.monitoring.sonataflow.arrays.store=MULTI_PARAM

There will be four entries added to the metrics

"param_name":"numbers[0].x","param_value":"12321"
"param_name":"numbers[0].y","param_value":"3"
"param_name":"numbers[1].x","param_value":"18"
"param_name":"numbers[1].y","param_value":"3232323"

Finally, If array mode value is STRING, then the whole array is stored as one big string, as by default, but the format is slightly different (remove quotes, so strings values cannot be differentiated from numbers but making easier the elastic search queries over them)
"param_value":"[{x=12321, y=3}, {x=18, y=3232323}]"

@fjtirado fjtirado requested review from nmirasch and gmunozfe April 29, 2024 16:47
@fjtirado fjtirado marked this pull request as ready for review April 29, 2024 17:01
@fjtirado fjtirado force-pushed the Fix_#3486 branch 6 times, most recently from 3542608 to 4afb6e3 Compare April 30, 2024 11:29
@fjtirado fjtirado requested a review from wmedvede May 3, 2024 09:17
@fjtirado fjtirado merged commit d6a74a5 into apache:main May 3, 2024
6 checks passed
rgdoliveira pushed a commit to rgdoliveira/kogito-runtimes that referenced this pull request May 7, 2024
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.

Optionally add input parameters to Serverless workflow metrics
3 participants