Sends Feature analytics event data to InfluxDB :param environment_id: (int) the id of the environment the feature is being evaluated within :param feature_evaluations: (dict) A collection of key id / evaluation counts
(
environment_id: int,
feature_evaluations: list[TrackFeatureEvaluationsByEnvironmentData],
)
| 114 | |
| 115 | |
| 116 | def track_feature_evaluation_influxdb( |
| 117 | environment_id: int, |
| 118 | feature_evaluations: list[TrackFeatureEvaluationsByEnvironmentData], |
| 119 | ) -> None: |
| 120 | """ |
| 121 | Sends Feature analytics event data to InfluxDB |
| 122 | |
| 123 | :param environment_id: (int) the id of the environment the feature is being evaluated within |
| 124 | :param feature_evaluations: (dict) A collection of key id / evaluation counts |
| 125 | """ |
| 126 | influxdb = InfluxDBWrapper("feature_evaluation") # type: ignore[no-untyped-call] |
| 127 | |
| 128 | for feature_evaluation in feature_evaluations: |
| 129 | tags: dict[str | Label, str | int] = { |
| 130 | "feature_id": feature_evaluation["feature_name"], |
| 131 | "environment_id": environment_id, |
| 132 | **map_labels_to_influx_record_values(feature_evaluation["labels"]), |
| 133 | } |
| 134 | influxdb.add_data_point( |
| 135 | "request_count", |
| 136 | feature_evaluation["evaluation_count"], |
| 137 | tags=tags, |
| 138 | ) |
| 139 | |
| 140 | influxdb.write() |
| 141 | |
| 142 | |
| 143 | def track_feature_evaluation_influxdb_v2( |
searching dependent graphs…