Package: windchill-metric-config
Windchill Metric ConfigConfiguration parser for windchill prometheus metrics. Parses json and yaml configuration files into a Python object.End result is a grafana dashboard as follows:UsageTo load the python object with a yaml file (as shown in chapter Example Config) change variable and save it again.from windchill_metric_config.configurator import Metricsmetrics_config = Metrics()dict_config = {system: {memory_total_bytes: {id: "process_real_memory_total_bytes",labels: ["host","resource_type","environment","company"],description: "system total memory in bytes",enabled: true}}}metrics_config.load_config_from_yaml_file(yaml_config_file)metrics_config.system.cpu_usage.enabled = Truemetrics_config.save_as_yaml('/config/second_config.yaml')To load the python object as a dict (as shown in chapter Example Config) change variable and save it again.fromwindchill_metric_config.configuratorimportMetricsmetrics_config=Metrics()metrics_config.set_config(yaml_config_file)print('show me the config as dict{}'.format(metrics_config.as_dict()))To validate metrics you can call the function "validate_metric"fromwindchill_metric_config.configuratorimportMetricsmetrics_config=Metrics()yaml_config_file='/config/first_config.yaml'metrics_config.load_config_from_yaml_file(yaml_config_file)some_metrics={'metric_id':"process_real_memory_total_bytes",'labels':{'label1':'My Company','label2':'Productive Environment','label3':'Windchill Server','label4':'some other text','host':'testserver.atmycompany.me'},'value':20.35}validate=metrics_config.validate_metric(some_metrics)print('is metric valid:{}'.format(validate))Example ConfigAn Overview of all scrapeable metrics is shown below:system:mimamorisan_api_version:false# mimamorisan api info, like [python_version, build_timestamp, compiler, version, build_hostmimamorisan_frontend_version:false# mimamorisan frontend info, like [vuejs_version, build_timestamp, version, build_hostprocess_real_memory_total_bytes:false# system total memory in bytesprocess_real_memory_used_bytes:false# system used memory in bytesprocess_cpu_usage_percent:false# cpu utilisation in percentprocess_disc_total_bytes:false# total disc space in bytesprocess_disc_used_bytes:false# used disc space in bytesprocess_users_total_count:false# count of logged in users on osprocess_users_list:false# list of os all userssystem_boot_timestamp:false# boot timestamp as label in iso format (ex, 2019-09-07T15:50-04:00)system_stats_info:false# various information about the host system, (logical cpu count, machine, node, physical_cpu_count, processor, os system, version and release)network:process_network_bytes_sent:false# bytes sent over all network addressesprocess_network_packets_recv:false# bytes received over all network addressesprocess_network_err_in:false# total number of errors while receivingprocess_network_err_out:false# total number of errors while sendingprocess_network_drop_in:false# total number of incoming packets which were droppedprocess_network_drop_out:false# total number of outgoing packets which were dropped (always 0 on macOS and BSD)process_windows_service_status:false# windows service information (only available on windows machines)windchill:windchill_apache_status:false# windchill apache status (503=not running, >1=http code)windchill_windchill_status:false# windchill app status (503=not running, >1=http code)windchill_api_response_time_seconds:false# windchill api (/Windchill/api/v1/publishmonitor/getworkerinfo.jsp) response timewindchill_active_users_total:false# windchill total active users countwindchill_active_users_list:false# windchill total active users by namewindchill_version_info:false# windchill version and release infowindchill_version_info_simple:false# windchill version and release infowindchill_installed_languages:false# windchill installed languagesmethod_server:windchill_server_status_runtime_start_time:false# windchill apache status (0=not running, >1=http code)windchill_server_status_runtime_uptime:false# windchill apache status (0=not running, >1=http code)queue_worker:windchill_worker_status:false# windchill worker status (0=Off, 1=On, 2=Busy, 3=FailsToStart, 4=NotDefined)windchill_queue_jobs_failed:false# windchill queue failed jobs amountwindchill_queue_jobs_total:false# windchill queue total jobs queue countgarbage_collector:windchill_garbage_coll_time_spent_in_threshold_percent:false# Garbage collection time spent in threshold percentwindchill_garbage_coll_recent_time_spent_percent:false# Garbage collection time spent recent percentwindchill_garbage_coll_overall_time_spent_percent:false# Garbage collection time spent overall percentmemory:windchill_memory_heap_usage_threshold_percent:false# Heap memory usage threshold in percentwindchill_memory_heap_usage_percent:false# Heap memory usage in percentwindchill_memory_perm_gen_usage_threshold_percent:false# Perm gen memory usage threshold in percentwindchill_memory_perm_gen_usage_percent:false# Perm gen memory usage in percentmethod_context:windchill_mc_active_context_average:false# activeContextsAveragewindchill_mc_active_context_end:false# activeContextsEndwindchill_mc_active_context_max:false# activeContextsMaxwindchill_mc_active_context_start:false# activeContextsStartwindchill_mc_blocked_count_per_context:false# averageBlockedCountPerContextwindchill_mc_cobra_calls_per_context_average:false# averageCORBACallsPerContextwindchill_mc_jdbc_calls_per_context_average:false# averageJDBCCallsPerContextwindchill_mc_jndi_calls_per_context_average:false# averageJNDICallsPerContextwindchill_mc_remote_cache_calls_per_context_average:false# averageRemoteCacheCallsPerContextwindchill_mc_waited_count_per_context:false# averageWaitedCountPerContextwindchill_mc_completed_context:false# completedContextswindchill_mc_cpu_seconds_average:false# contextCpuSecondsAveragewindchill_mc_jdbc_conn_wait_seconds_average:false# contextJDBCConnWaitSecondsAveragewindchill_mc_seconds_average:false# contextSecondsAveragewindchill_mc_seconds_max:false# contextSecondsMaxwindchill_mc_user_seconds_average:false# contextUserSecondsAveragewindchill_mc_context_per_seconds:false# contextsPerSecondwindchill_mc_error_count:false# errorCountwindchill_mc_blocked_time_per_context_percentage:false# percentageOfContextTimeBlockedwindchill_mc_cobra_time_of_context_percentage:false# percentageOfContextTimeInCORBACallswindchill_mc_jdbc_time_of_context_percentage:false# percentageOfContextTimeInJDBCCallswindchill_mc_jdbc_time_conn_wait_percentage:false# windchill_mc_jdbc_time_conn_wait_percentagewindchill_mc_jndi_time_of_context_percentage:false# percentageOfContextTimeInJDBCConnWaitwindchill_mc_remote_cache_time_of_context_percentage:false# percentageOfContextTimeInJNDICallswindchill_mc_time_waited_time_of_context_percentage:false# percentageOfContextTimeWaitedwindchill_mc_redirect_count:false# redirectCountsessions:windchill_active_sessions_average:false# activeSessionsAveragewindchill_active_sessions_end:false# activeSessionsEndwindchill_active_sessions_max:false# activeSessionsMaxwindchill_active_sessions_start:false# activeSessionsStartwindchill_sessions_activated:false# sessionsActivatedwindchill_sessions_created:false# sessionsCreatedwindchill_sessions_destroyed:false# sessionsDestroyedwindchill_sessions_passivated:false# sessionsPassivatedservlet_requests:windchill_servlet_active_requests_average:false# activeRequestsAveragewindchill_servlet_active_requests_end:false# activeRequestsEndwindchill_servlet_active_requests_max:false# activeRequestsMaxwindchill_servlet_active_requests_start:false# activeRequestsStartwindchill_servlet_blocked_count_per_request:false# averageBlockedCountPerRequestwindchill_servlet_ie_calls_per_request:false# averageIECallsPerRequestwindchill_servlet_jndi_calls_per_request:false# averageJNDICallsPerRequestwindchill_servlet_rmi_calls_per_request:false# averageRMICallsPerRequestwindchill_servlet_soap_call_per_request:false# averageSOAPCallsPerRequestwindchill_servlet_waited_count_per_request:false# averageWaitedCountPerRequestwindchill_servlet_completed_requests:false# completedRequestswindchill_servlet_error_count:false# errorCountwindchill_servlet_blocked_time_percentage:false# percentageOfRequestTimeBlockedwindchill_servlet_ie_calls_time_percentage:false# percentageOfRequestTimeInIECallswindchill_servlet_jndi_calls_time_percentage:false# percentageOfRequestTimeInJNDICallswindchill_servlet_rmi_calls_time_percentage:false# percentageOfRequestTimeInRMICallswindchill_servlet_soap_calls_time_percentage:false# percentageOfRequestTimeInSOAPCallswindchill_servlet_time_waited_percentage:false# percentageOfRequestTimeWaitedwindchill_servlet_cpu_seconds_average:false# requestCpuSecondsAveragewindchill_servlet_requests_seconds_average:false# requestSecondsAveragewindchill_servlet_requests_seconds_max:false# requestSecondsMaxwindchill_servlet_requests_user_seconds_average:false# requestUserSecondsAveragewindchill_servlet_requests_per_second:false# requestsPerSecondupload to pypi.orgpy-mbuild
py-mtwineupload--repositorypypidist/*Changelogv0.0.33Now with imagev0.0.32more labels (former company and environment => new label1, label2, label3, label4)better documentation