Skip to content

Commit

Permalink
chore: remove cf version metadata as it can't be used from terraform
Browse files Browse the repository at this point in the history
  • Loading branch information
zackpollard committed Aug 21, 2024
1 parent 7bf8d78 commit db678ab
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 13 deletions.
5 changes: 1 addition & 4 deletions tiles/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,7 @@ export default {
const headerProvider = new HeaderMetricsProvider();
const influxProvider = new InfluxMetricsProvider(workerEnv.VMETRICS_API_TOKEN, env.ENVIRONMENT);
deferredRepository.defer(() => influxProvider.flush());
const metrics = new CloudflareMetricsRepository('tiles', request, deferredRepository, workerEnv, [
influxProvider,
headerProvider,
]);
const metrics = new CloudflareMetricsRepository('tiles', request, [influxProvider, headerProvider]);

try {
const response = await metrics.monitorAsyncFunction({ name: 'handle_request' }, handleRequest)(
Expand Down
4 changes: 0 additions & 4 deletions tiles/src/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,16 +251,12 @@ export class CloudflareMetricsRepository implements IMetricsRepository {
constructor(
private operationPrefix: string,
request: Request<unknown, IncomingRequestCfProperties>,
private deferredRepository: IDeferredRepository,
private env: WorkerEnv,
private metricsProviders: IMetricsProviderRepository[],
) {
this.defaultTags = {
continent: request.cf?.continent ?? '',
colo: request.cf?.colo ?? '',
asOrg: request.cf?.asOrganization ?? '',
scriptTag: env.CF_VERSION_METADATA.tag,
scriptId: env.CF_VERSION_METADATA.id,
};
}

Expand Down
3 changes: 1 addition & 2 deletions tiles/worker-configuration.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated by Wrangler on Fri Aug 16 2024 18:07:01 GMT+0100 (British Summer Time)
// Generated by Wrangler on Wed Aug 21 2024 18:15:03 GMT+0100 (British Summer Time)
// by running `wrangler types`

interface Env {
Expand All @@ -7,5 +7,4 @@ interface Env {
PMTILES_FILE_HASH: "prodv1";
ENVIRONMENT: "production";
BUCKET: R2Bucket;
CF_VERSION_METADATA: { id: string; tag: string };
}
3 changes: 0 additions & 3 deletions tiles/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ binding = "BUCKET"
bucket_name = "tiles"
preview_bucket_name = "tiles"

[version_metadata]
binding = "CF_VERSION_METADATA"

# Define environment variables for your Workers script
[vars]
PMTILES_FILE_NAME = "v1.pmtiles"
Expand Down

0 comments on commit db678ab

Please sign in to comment.