Skip to content

Add code_host_integration_usage pings

Created by: erzhtor

Closes https://github.com/sourcegraph/sourcegraph/issues/31059.

See also schema update PR https://github.com/sourcegraph/analytics/pull/357

Test plan

  • run sg start
  • Check that pings (in admin panel or event_logs table) include codeHostIntegrationUsage json field
Example data
{
...
"codeHostIntegrationUsage": {
        "Day": {
            "StartTime": "2022-02-16T00:00:00Z",
            "BrowserExtension": {
                "TotalCount": 1,
                "UniquesCount": 1,
                "InboundTrafficToWeb": {
                    "TotalCount": 1,
                    "UniquesCount": 1
                }
            },
            "NativeIntegration": {
                "TotalCount": 0,
                "UniquesCount": 0,
                "InboundTrafficToWeb": {
                    "TotalCount": 0,
                    "UniquesCount": 0
                }
            }
        },
        "Week": {
            "StartTime": "2022-02-14T00:00:00Z",
            "BrowserExtension": {
                "TotalCount": 1,
                "UniquesCount": 1,
                "InboundTrafficToWeb": {
                    "TotalCount": 1,
                    "UniquesCount": 1
                }
            },
            "NativeIntegration": {
                "TotalCount": 0,
                "UniquesCount": 0,
                "InboundTrafficToWeb": {
                    "TotalCount": 0,
                    "UniquesCount": 0
                }
            }
        },
        "Month": {
            "StartTime": "2022-02-01T00:00:00Z",
            "BrowserExtension": {
                "TotalCount": 1,
                "UniquesCount": 1,
                "InboundTrafficToWeb": {
                    "TotalCount": 1,
                    "UniquesCount": 1
                }
            },
            "NativeIntegration": {
                "TotalCount": 0,
                "UniquesCount": 0,
                "InboundTrafficToWeb": {
                    "TotalCount": 0,
                    "UniquesCount": 0
                }
            }
        }
    }
}

Merge request reports

Loading