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

Multiple Identifier #112

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

Multiple Identifier #112

wants to merge 9 commits into from

Conversation

salisbuk7897
Copy link
Contributor

This pull request contains changes that allow users to specify multiple identifiers in there metrics.json file. it was tested using the following metrics json

{
"RPRT_ALL_UVC": {
"lpar": "RPRT",
"request": {
"report": "CHANNEL",
"resource": ",RPRT,MVS_IMAGE"
},
"identifiers": [
{
"key": "CHACPTVC",
"value": "ALL"
},
{
"key": "CHACPIVC",
"value": "ALL"
}
],
"field": "CHACPUVC",
"desc": "Channel"
}
}

@fernandozangari
Copy link
Collaborator

Great news!! this enhanced code is already available to download?

@salisbuk7897
Copy link
Contributor Author

@fernandozangari Alex will have to test and merge it before it becomes available on zebra github but if you want to download the enhanced code now, you can download it from my zebra fork at https://github.com/salisbuk7897/zebra.git. Just know that the metrics UI is not completed yet, so you can edit the metrics.json manually to add identifiers

@fernandozangari
Copy link
Collaborator

Ok, thanks, no problem, I always use the metrics.json file.

@salisbuk7897
Copy link
Contributor Author

Okay cool. You are welcome

@fernandozangari
Copy link
Collaborator

Hi Salisu, I tested the multi identifier update with the following metrics.json file, but doesn´t work as expeceted

{
"PC1B_CPCPPNAM_MSU": {
"lpar": "PC1B",
"request": {"report": "CPC","resource": ",PC1B,MVS_IMAGE"},
"identifiers": [{"key": "CPCPPNAM","value": "ALL"}],
"field": "CPCPAMSU", "desc": "Actual consumed MSUs"
},
"PC1B_ALL_CH": {
"lpar": "PC1B",
"request": {"report": "CHANNEL","resource": ",PC1B,MVS_IMAGE"},
"identifiers": [
{"key": "CHACPTVC","value": "ALL"},
{"key": "CHACPIVC","value": "ALL"}
],
"field": "CHACPUVC",
"desc": "Channel - Part util %"
},
"PC1B_ALL_AS2": {
"lpar": "PC1B",
"request": {"report": "USAGE","resource": ",PC1B,MVS_IMAGE"},
"identifiers": [
{"key": "JUSPJOB","value": "ALL"},
{"key": "JUSPSVCL","value": "ALL"},
{"key": "JUSPCLA","value": "ALL"},
{"key": "JUSPASI","value": "ALL"}
],
"field": "JUSPCPUD",
"desc": "CPU time for interval (in seconds)"
}
}

for example, for the Channel metric (PC1B_ALL_CH) I expect one metric name like

PC1B_FC_04_CH

but obtain two metrics

PC1B_FC_CHACPTVC and PC1B_04_CHACPIVC

The same for Address Spaces (PC1B_ALL_AS2)

expected PC1B_RMFGAT_SYSSTC_S_0112_AS2 and obtain (4 metrics)

PC1B_RMFGAT_JUSPJOB
PC1B_SYSSTC_JUSPSVCL
PC1B_S_JUSPCLA
PC1B_0112_JUSPASI

I am sorry that the update doesn´t work as expected. Please tell me if I can help. Thanks

@fernandozangari
Copy link
Collaborator

The json output from ZEBRA app/site for job

{"JUSPJOB":"RMFGAT","JUSPASI":"0112","JUSPCLA":"S","JUSPCLAX":"SO","JUSPSVCL":"SYSSTC","JUSPCLP":"1","JUSPDP":"FE","JUSPTAT":"264:24:40","JUSPTRT":"264:24:40","JUSPTCT":"1","JUSPFRT":"22037","JUSPFRXT":"482","JUSPFRXH":"460","JUSPFRXA":"22","JUSPFRXB":"0","JUSPDCTT":"105.8800","JUSPDCTD":"0.014","JUSPEXCR":"0.17","JUSPCPUT":"1418.34","JUSPCPUD":"0.11","JUSPTCBT":"1408.27","JUSPTCBD":"0.11","JUSPQREQ":"0","JUSPQSPR":"0","JUSPQRES":"0.000","JUSPQRSD":"0.0","JUSPQTIM":"0","JUSPQTSD":"0"},

@salisbuk7897
Copy link
Contributor Author

@fernandozangari Thanks for testing and reporting the bug. actually it was a mistake from my side, Just like you mentioned, PC1B_FC_04_CH is supposed to be correct output. but I replaced the CH with the Identifier key just to be sure I was getting all identifiers. That's why you got PC1B_FC_CHACPTVC and PC1B_04_CHACPIVC instead of PC1B_FC_CH. I will fix that and we can discuss more if there is need to add the identifier key to the prometheus metrics to allow for easier Identification

@fernandozangari
Copy link
Collaborator

@salisbuk7897 Thanks!!, I am checking the results from prometheus and I thought (erroneously probably) that the identifiers would appear in the prometheus metrics. I wait to the resolution and test again. Thank you.

Signed-off-by: Salisu Ali <[email protected]>
@salisbuk7897
Copy link
Contributor Author

@fernandozangari The metric name change has been made. The naming structure is lpar_identifier_desc. You can choose a desc of your choice for each identifier. a sample for the new metrics json structure is as follows:

{ "RPRT_ALL_UVC": { "lpar": "RPRT", "request": { "report": "CHANNEL", "resource": ",RPRT,MVS_IMAGE" }, "identifiers": [ { "key": "CHACPTVC", "value": "ALL", "desc" : "CH" }, { "key": "CHACPIVC", "value": "ALL", "desc" : "CH1" } ], "field": "CHACPUVC", "desc": "Channel" } }

Signed-off-by: Salisu Ali <[email protected]>
@salisbuk7897
Copy link
Contributor Author

@fernandozangari @behives The Metrics user interface is complete. You can test it. There is a readme under user guide (9. create_metrics.md) that explains the new changes and This YouTube video takes us through creating metrics with the interface (https://youtu.be/P69Rnv8F3tU)

@fernandozangari
Copy link
Collaborator

thanks @salisbuk7897, I will check it

@fernandozangari
Copy link
Collaborator

Hi @salisbuk7897, which is the correct link to the code to test? Thanks

@salisbuk7897
Copy link
Contributor Author

@fernandozangari
Copy link
Collaborator

Hi @salisbuk7897, I checked it, it works and reduces the verbose of metrics.json file, but what I mean (surely I was not clear) is something like this

"LPR1_CH": {"lpar": "LPR1","request": {"report": "CHANNEL","resource": ",LPR1,MVS_IMAGE"},
"identifiers": [
{"field": "CHACPUVC",
"id": [{key: "CHACPIVC","value": "ALL"},
{key: "CHACPTVC","value": "ALL"}],
"m_id": "CHLPAR","desc": "Partition utlization percent"},
{"field": "CHACTUVC",
"id": [{key: "CHACPIVC","value": "ALL"},
{key: "CHACPTVC","value": "ALL"}],
"m_id": "CHTOT","desc": "Total utilization percent"}
]
}

where id is an identifier formed by

CHACPIVC: Channel path ID (may be ALL or discrete)
CHACPTVC: Channel path type (may be ALL or discrete)

so the metric ID will be a little different from

{LPAR}{IDENTIFIER_VALUE}{METRIC_ID}

by

{LPAR}{multi_key(separated by "-" or "")}_{METRIC_ID}

LPR1_{CHACPIVC_CHACPTVC}_CHTOT: the benefits of these is that with one metric we have two types of classification and masking; in Grafana we have the
possibility of grouping in two or more levels.

For example, in the case of Address Spaces we can add Class of execution and type of AS (Job, STC or TSO).

Hoping that this is possible and not complicate your existence.

@fernandozangari
Copy link
Collaborator

Hi @salisbuk7897, a doubt, there is a back compatibility with the old naming convention of metrics.json?

@salisbuk7897
Copy link
Contributor Author

@fernandozangari I get it now. The idea is to have multiple identifier names, separated by _ (LPR1_{CHACPIVC_CHACPTVC}_CHTOT), but the field remains the same for both identifier names. This is also possible. I will be able to work on it

@fernandozangari
Copy link
Collaborator

Hi @salisbuk7897, YES and THANKS!

@salisbuk7897
Copy link
Contributor Author

@fernandozangari sorry I didn't understand this: " back compatibility with the old naming convention of metrics.json". The naming convention within the metrics.json file has changed but the metrics exposed for grafana through /prommetrics are backward compatible. If that didn't answer the question. Please elaborate. Thanks

@fernandozangari
Copy link
Collaborator

@salisbuk7897 , OK, I understand. Thanks

Signed-off-by: Salisu Ali <[email protected]>
@salisbuk7897
Copy link
Contributor Author

@fernandozangari Sorry for the long time it took to get back to you on this butI have implemented what we discussed her. you can test the changes from my repo https://github.com/salisbuk7897/zebra/tree/main. This sample metrics.json was used but you can use any metrics of your choice to test
{ "RPRT_CHANNEL": { "lpar": "RPRT", "multi": true, "request": { "report": "CHANNEL", "resource": ",SYS,MVS_IMAGE" }, "identifiers": [ { "field": "CHACPUVC", "id": [ {"key": "CHACPIVC","value": "ALL"}, {"key": "CHACPTVC","value": "ALL"} ], "m_id": "CHLPAR", "desc": "Partition utlization percent" }, { "field": "CHACTUVC", "id": [ {"key": "CHACPIVC","value": "ALL"}, {"key": "CHACPTVC","value": "ALL"} ], "m_id": "CHTOT", "desc": "Total utilization percent" }, { "field": "CHACMGVC", "id": [ {"key": "CHACPIVC","value": "02"}, {"key": "CHACPTVC","value": "OSD"} ], "m_id": "CHCVG", "desc": "Total utilization percent" } ] } }

@fernandozangari
Copy link
Collaborator

Hi Salisu, THANKS! I will test it.

@salisbuk7897
Copy link
Contributor Author

The major changes to the metrics.json file is:
1- the multi parameter: this need to be set to true for ZEBRA to treat the metrics as having multiple identifiers

Both instances of the two identifier keys having discrete value or "ALL" as their value has been tested. feel free to let me know if there is a need to add, remove or adjust anything. the multiple metrics now look like this:

image

@salisbuk7897
Copy link
Contributor Author

Hi Salisu, THANKS! I will test it.

That was fast. YW.. looking forward to your comments

@fernandozangari
Copy link
Collaborator

Hi Salisu, the change works REALLY FINE!, I can now add the name of the SYSPLEX in the LPAR name, ASID in Address Space name and type of channel in the channel name, without implying more metrics but we have more detail classifications, and in consequence more dimensions for the analysis. Really great work!

PD: a doubt, it is limited to two identifiers?

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.

3 participants