emqx_prometheus.hrl 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. %%--------------------------------------------------------------------
  2. %% Copyright (c) 2020-2024 EMQ Technologies Co., Ltd. All Rights Reserved.
  3. %%
  4. %% Licensed under the Apache License, Version 2.0 (the "License");
  5. %% you may not use this file except in compliance with the License.
  6. %% You may obtain a copy of the License at
  7. %%
  8. %% http://www.apache.org/licenses/LICENSE-2.0
  9. %%
  10. %% Unless required by applicable law or agreed to in writing, software
  11. %% distributed under the License is distributed on an "AS IS" BASIS,
  12. %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. %% See the License for the specific language governing permissions and
  14. %% limitations under the License.
  15. %%--------------------------------------------------------------------
  16. -define(APP, emqx_prometheus).
  17. -define(PROMETHEUS, [prometheus]).
  18. -define(PROMETHEUS_DEFAULT_REGISTRY, default).
  19. -define(PROMETHEUS_AUTH_REGISTRY, '/prometheus/auth').
  20. -define(PROMETHEUS_AUTH_COLLECTOR, emqx_prometheus_auth).
  21. -define(PROMETHEUS_DATA_INTEGRATION_REGISTRY, '/prometheus/data_integration').
  22. -define(PROMETHEUS_DATA_INTEGRATION_COLLECTOR, emqx_prometheus_data_integration).
  23. -define(PROMETHEUS_MESSAGE_VALIDATION_REGISTRY, '/prometheus/message_validation').
  24. -define(PROMETHEUS_MESSAGE_VALIDATION_COLLECTOR, emqx_prometheus_message_validation).
  25. -if(?EMQX_RELEASE_EDITION == ee).
  26. -define(PROMETHEUS_EE_REGISTRIES, [
  27. ?PROMETHEUS_MESSAGE_VALIDATION_REGISTRY
  28. ]).
  29. %% ELSE if(?EMQX_RELEASE_EDITION == ee).
  30. -else.
  31. -define(PROMETHEUS_EE_REGISTRIES, []).
  32. %% END if(?EMQX_RELEASE_EDITION == ee).
  33. -endif.
  34. -define(PROMETHEUS_ALL_REGISTRIES,
  35. ?PROMETHEUS_EE_REGISTRIES ++
  36. [
  37. ?PROMETHEUS_DEFAULT_REGISTRY,
  38. ?PROMETHEUS_AUTH_REGISTRY,
  39. ?PROMETHEUS_DATA_INTEGRATION_REGISTRY
  40. ]
  41. ).
  42. -define(PROM_DATA_MODE__NODE, node).
  43. -define(PROM_DATA_MODE__ALL_NODES_AGGREGATED, all_nodes_aggregated).
  44. -define(PROM_DATA_MODE__ALL_NODES_UNAGGREGATED, all_nodes_unaggregated).
  45. -define(PROM_DATA_MODES, [
  46. ?PROM_DATA_MODE__NODE,
  47. ?PROM_DATA_MODE__ALL_NODES_AGGREGATED,
  48. ?PROM_DATA_MODE__ALL_NODES_UNAGGREGATED
  49. ]).
  50. -define(PROM_DATA_MODE_KEY__, prom_data_mode).
  51. -define(PUT_PROM_DATA_MODE(MODE__), erlang:put(?PROM_DATA_MODE_KEY__, MODE__)).
  52. -define(GET_PROM_DATA_MODE(), erlang:get(?PROM_DATA_MODE_KEY__)).