def track_request_influxdb(
    resource: Resource | None,
    host: str,
    environment: "Environment",
    count: int = 1,
) -> None:
    """
    Sends API event data to InfluxDB

    :param request: (HttpRequest) the request being made
    """
    if resource and resource.is_tracked:
        if environment is None:
            return

        tags = {
            "resource": resource.resource_name,
            "organisation": environment.project.organisation.get_unique_slug(),
            "organisation_id": environment.project.organisation_id,
            "project": environment.project.name,
            "project_id": environment.project_id,
            "environment": environment.name,
            "environment_id": environment.id,
            "host": host,
        }

        influxdb = InfluxDBWrapper("api_call")  # type: ignore[no-untyped-call]
        influxdb.add_data_point("request_count", count, tags=tags)
        influxdb.write()

    Sends API event data to InfluxDB

    :param request: (HttpRequest) the request being made
    
api/app_analytics/track.py