Skip to content

Commit

Permalink
Use shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunemaker committed Nov 18, 2023
1 parent 771c531 commit bdf5f84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/flipper/cloud/telemetry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ def post_to_cloud(drained)
metric.as_json(with: {"value" => value})
}

body = Serializers::Json.serialize({
body = Typecast.to_json({
request_id: SecureRandom.uuid,
enabled_metrics: enabled_metrics,
})
http_client = @cloud_configuration.http_client
http_client.add_header :schema_version, SCHEMA_VERSION
http_client.add_header :content_encoding, 'gzip'
http_client.post "/telemetry", Serializers::Gzip.serialize(body)
http_client.post "/telemetry", Typecast.to_gzip(body)
rescue => error
# FIXME: Retry for net/http server errors
logger.debug "name=flipper_telemetry action=post_to_cloud error=#{error.inspect}"
Expand Down

0 comments on commit bdf5f84

Please sign in to comment.