{"componentChunkName":"component---src-templates-doc-tsx","path":"/product/relay/operating-guidelines/","result":{"data":{"file":{"id":"12f51cc6-d76a-5b9d-b549-aad4259a3a72","relativePath":"product/relay/operating-guidelines.mdx","sourceInstanceName":"docs","childMarkdownRemark":null,"childMdx":{"body":"function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"title\": \"Operating Guidelines\",\n  \"description\": \"Learn about our guidelines for operation when self-hosting external Relays.\",\n  \"sidebar_order\": 5,\n  \"redirect_from\": [\"/meta/relay/best-practices/\", \"/product/relay/best-practices/\"]\n};\n\nvar makeShortcode = function makeShortcode(name) {\n  return function MDXDefaultShortcode(props) {\n    console.warn(\"Component \" + name + \" was not imported, exported, or provided by MDXProvider as global scope\");\n    return mdx(\"div\", props);\n  };\n};\n\nvar CodeTabs = makeShortcode(\"CodeTabs\");\nvar CodeBlock = makeShortcode(\"CodeBlock\");\nvar Alert = makeShortcode(\"Alert\");\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, [\"components\"]);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"This page reviews our guidelines for operation when self-hosting external Relays, that is, Relays that run on your hardware and forward events to \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"sentry.io\"), \".\"), mdx(\"h2\", {\n    \"id\": \"general-considerations\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h2\"\n  }, {\n    \"href\": \"#general-considerations\",\n    \"aria-label\": \"general considerations permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"General Considerations\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"We recommend \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"/product/relay/getting-started/#running-relay-in-docker\"\n  }), \"running Relay\"), \" using the officially provided Docker image (\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"getsentry/relay\"), \") found on \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"https://hub.docker.com/r/getsentry/relay/\"\n  }), \"DockerHub\"), \" and tagged with its Git revision identifier, rather than building from source.\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"We recommend running at least two Relay instances (containers) with a reverse proxy (such as \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"https://www.haproxy.org/\"\n  }), \"HAProxy\"), \" or \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"https://nginx.org\"\n  }), \"Nginx\"), \") in front of them for both improved availability and simplified Relay updates.\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"To monitor your Relay setup, configure \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"/product/relay/monitoring/#logging\"\n  }), \"Logging\"), \", \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"/product/relay/monitoring/#metrics\"\n  }), \"Metrics\"), \", and \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"/product/relay/monitoring/#health-checks\"\n  }), \"Health Checks\"), \".\"))), mdx(\"h2\", {\n    \"id\": \"system-requirements-and-recommendations\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h2\"\n  }, {\n    \"href\": \"#system-requirements-and-recommendations\",\n    \"aria-label\": \"system requirements and recommendations permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"System Requirements and Recommendations\"), mdx(\"p\", null, \"The following recommendations assume that Relay is run in Docker.\"), mdx(\"table\", null, mdx(\"tbody\", null, mdx(\"tr\", null, mdx(\"th\", null, \"Resource\"), mdx(\"th\", null, \"Recommendations\")), mdx(\"tr\", null, mdx(\"td\", null, \"CPU\"), mdx(\"td\", null, mdx(\"ul\", null, mdx(\"li\", null, mdx(\"strong\", null, \"Required\"), \": x86-64 (amd64) CPU architecture\"), mdx(\"li\", null, \"Multi-core CPU \", mdx(\"a\", {\n    href: \"#multi-core-cpu\",\n    id: \"multi-core-footnote\"\n  }, \"[1]\"))))), mdx(\"tr\", null, mdx(\"td\", null, \"Memory\"), mdx(\"td\", null, mdx(\"ul\", null, mdx(\"li\", null, \"At least 2GB of RAM per Relay container is recommended.\")))), mdx(\"tr\", null, mdx(\"td\", null, \"Network\"), mdx(\"td\", null, mdx(\"ul\", null, mdx(\"li\", null, \"Bandwidth: Make sure you have enough capacity to receive and forward the planned data volume. Relay compresses all upstream requests to \", mdx(\"code\", null, \"sentry.io\"), \" by default, but the compression rate might vary depending on the types and shapes of the submitted events.\"), mdx(\"li\", null, \"Latency: Relay can tolerate network delays up to a certain point. It is however recommended to make sure that the round-trip time to the upstream stays lower than 5 seconds.\")))), mdx(\"tr\", null, mdx(\"td\", null, \"Storage\"), mdx(\"td\", null, mdx(\"ul\", null, mdx(\"li\", null, \"Relay does not currently require disk storage.\")))))), mdx(\"p\", {\n    id: \"multi-core-cpu\"\n  }, mdx(\"a\", {\n    href: \"#multi-core-footnote\"\n  }, \"[1]\"), \" Relay is a multi-threaded application that tries to leverage all available CPU cores. As a result, Sentry highly recommends running Relay on multi-core CPUs. If your setup is expected to handle more than 100 requests per second, we recommend running Relay on at least four (4) CPU cores. By default, every Relay instance will use the total number of available cores to adjust the sizes of its thread pools. Adjust this behavior by configuring the \", mdx(\"code\", null, \"limits.max_thread_count\"), \".\"), mdx(\"h2\", {\n    \"id\": \"example-configuration\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h2\"\n  }, {\n    \"href\": \"#example-configuration\",\n    \"aria-label\": \"example configuration permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"Example Configuration\"), mdx(\"p\", null, \"This example configuration sets up basic logging and metrics settings, as well as changes the default concurrency level.\"), mdx(\"div\", {\n    \"className\": \"code-tabs-wrapper\"\n  }, mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"yaml\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"yaml\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-yaml\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-yaml\"\n  }), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"---\"), \"\\n\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token key atrule\"\n  }), \"relay\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \":\"), \"\\n  \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token comment\"\n  }), \"# The upstream hostname is taken from any of your DSNs.\"), \"\\n  \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token comment\"\n  }), \"# Go to your Project Settings, and then to \\\"Client Keys (DSN)\\\" to see them.\"), \"\\n  \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token key atrule\"\n  }), \"upstream\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \":\"), \" https\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \":\"), \"//o<YOUR_ORG_ID\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \">\"), \".ingest.sentry.io.\\n  \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token key atrule\"\n  }), \"host\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \":\"), \" 0.0.0.0\\n  \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token key atrule\"\n  }), \"port\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \":\"), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token number\"\n  }), \"3000\"), \"\\n\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token key atrule\"\n  }), \"logging\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \":\"), \"\\n  \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token key atrule\"\n  }), \"level\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \":\"), \" info\\n  \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token key atrule\"\n  }), \"format\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \":\"), \" json\\n\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token key atrule\"\n  }), \"metrics\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \":\"), \"\\n  \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token key atrule\"\n  }), \"statsd\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \":\"), \" 127.0.0.1\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \":\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token number\"\n  }), \"8126\"), \"\\n  \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token key atrule\"\n  }), \"prefix\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \":\"), \" relay\\n\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token key atrule\"\n  }), \"limits\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \":\"), \"\\n  \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token comment\"\n  }), \"# Base size of various internal thread pools. Defaults to the number of logical CPU cores\"), \"\\n  \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token key atrule\"\n  }), \"max_thread_count\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \":\"), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token number\"\n  }), \"8\"))))))), mdx(\"p\", null, \"See the \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"/product/relay/options/\"\n  }), \"Configuration Options\"), \" page for detailed descriptions of all available options.\"), mdx(\"h2\", {\n    \"id\": \"performance-tuning\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h2\"\n  }, {\n    \"href\": \"#performance-tuning\",\n    \"aria-label\": \"performance tuning permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"Performance Tuning\"), mdx(\"p\", null, \"Relay provides a variety of \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"/product/relay/options/\"\n  }), \"Configuration Options\"), \". Changing some of the options has more impact on Relay's behavior than others.\\nThe following list identifies a few options you should check first when you want to tune Relay to your organization's environment and workload:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"limits.max_concurrent_requests\"), \" (default: 100)\"), mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Number of concurrent requests your Relay instance can send to\\nthe upstream (Sentry). If your event volume or connection latency to Sentry are high, you can increase this value to gain additional throughput, though that increase will be at the expense of additional network connections.\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"cache.event_buffer_size\"), \" (default: 1000)\"), mdx(\"p\", {\n    parentName: \"li\"\n  }, \"How many events Relay can buffer in its local queue before it starts rejecting new events.\\nIncreasing this value will also increase Relay's potential memory consumption when, for\\nexample, network issues prevent Relay from forwarding the received messages to Sentry.\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"cache.event_expiry\"), \" (in seconds, default: 600)\"), mdx(\"p\", {\n    parentName: \"li\"\n  }, \"How long Relay can keep buffered events in memory before dropping them. You can increase this value if you anticipate when your Relay may need to keep events in memory for longer than the default value.\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"cache.project_expiry\"), \" (in seconds, default: 300)\"), mdx(\"p\", {\n    parentName: \"li\"\n  }, \"To stay operational, Relay regularly fetches project configurations from the Sentry upstream. This setting controls how often Relay fetches that configuration. You can decrease this value to make the configuration propagation more frequent. For example, if you later change data scrubbing options in your project settings in Sentry, your Relay instance will become aware of those changes faster.\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"cache.project_grace_period\"), \" (in seconds, default: 0)\"), mdx(\"p\", {\n    parentName: \"li\"\n  }, \"How long a project configuration can still be used after having expired.\\nIncreasing this value may help when the upstream is unreachable; for example, due to network issues.\"))), mdx(\"h2\", {\n    \"id\": \"request-routing\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h2\"\n  }, {\n    \"href\": \"#request-routing\",\n    \"aria-label\": \"request routing permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"Request Routing\"), mdx(\"p\", null, \"SDKs communicate with Sentry on a set of endpoints. Relay provides the same API to become a seamless drop-in replacement. This requires a set of endpoints to be accessible:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"/api/<project-id>/envelope/\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"/api/<project-id>/minidump/\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"/api/<project-id>/security/\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"/api/<project-id>/store/\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"/api/<project-id>/unreal/\"))), mdx(\"p\", null, \"Depending on the SDK or client, requests to these endpoints are performed with compressed content-encoding or chunked transfer-encoding. Depending on the infrastructure in front of Relay, please check the following HTTP headers are set correctly:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"Host\"), \": to the public host name of this Relay\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"X-Forwarded-For\"), \": to the client IP address\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"X-Sentry-Auth\"), \": to the value provided by the client\")), mdx(Alert, {\n    level: \"info\",\n    mdxType: \"Alert\"\n  }, mdx(\"p\", null, \"Proxies often set a default maximum body size for requests. Especially native crash reports and attachments can exceed these limits. We recommend to configure a maximum client body size of \", mdx(\"em\", {\n    parentName: \"p\"\n  }, \"100MB\"), \".\")), mdx(\"p\", null, \"Internally, Relay makes requests to the configured upstream to forward data and retrieve project configuration. We \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"highly recommend against\"), \" constraining these requests. At present, Relay makes requests to the following endpoints for basic operation:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"All of the above endpoints\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"/api/0/relays/projectconfigs/\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"/api/0/relays/publickeys/\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"/api/0/relays/register/challenge/\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"/api/0/relays/register/response/\"))));\n}\n;\nMDXContent.isMDXComponent = true;","tableOfContents":{"items":[{"url":"#general-considerations","title":"General Considerations"},{"url":"#system-requirements-and-recommendations","title":"System Requirements and Recommendations"},{"url":"#example-configuration","title":"Example Configuration"},{"url":"#performance-tuning","title":"Performance Tuning"},{"url":"#request-routing","title":"Request Routing"}]},"internal":{"type":"Mdx"}}}},"pageContext":{"excerpt":"This page reviews our guidelines for operation when self-hosting external Relays, that is, Relays that run on your hardware and forward events to  sentry.io . General Considerations We recommend  running Relay  using the officially provided Docker image ( getsentry/relay ) found on  DockerHub  and tagged with its Git revision identifier, rather than building from source. We recommend running at least two Relay instances (containers) with a reverse proxy (such as  HAProxy  or  Nginx ) in front of them for both improved availability and simplified Relay updates. To monitor your Relay setup, configure  Logging ,  Metrics , and  Health Checks . System Requirements and Recommendations The following recommendations assume that Relay is run in Docker. Example Configuration This example configuration sets up basic logging and metrics settings, as well as changes the default concurrency level. See the  Configuration Options  page for detailed descriptions of all available options. Performance Tuning Relay provides a variety of  Configuration Options . Changing some of the options has more impact on Relay's behavior than others. \nThe following list identifies a few options you should check first when you want to tune Relay to your organization's environment and workload: limits.max_concurrent_requests  (default: 100) Number of concurrent requests your Relay instance can send to\nthe upstream (Sentry). If your event volume or connection latency to Sentry are high, you can increase this value to gain additional throughput, though that increase will be at the expense of additional network connections. cache.event_buffer_size  (default: 1000) How many events Relay can buffer in its local queue before it starts rejecting new events.\nIncreasing this value will also increase Relay's potential memory consumption when, for\nexample, network issues prevent Relay from forwarding the received messages to Sentry. cache.event_expiry  (in seconds, default: 600) How long Relay can keep buffered events in memory before dropping them. You can increase this value if you anticipate when your Relay may need to keep events in memory for longer than the default value. cache.project_expiry  (in seconds, default: 300) To stay operational, Relay regularly fetches project configurations from the Sentry upstream. This setting controls how often Relay fetches that configuration. You can decrease this value to make the configuration propagation more frequent. For example, if you later change data scrubbing options in your project settings in Sentry, your Relay instance will become aware of those changes faster. cache.project_grace_period  (in seconds, default: 0) How long a project configuration can still be used after having expired.\nIncreasing this value may help when the upstream is unreachable; for example, due to network issues. Request Routing SDKs communicate with Sentry on a set of endpoints. Relay provides the same API to become a seamless drop-in replacement. This requires a set of endpoints to be accessible: /api/<project-id>/envelope/ /api/<project-id>/minidump/ /api/<project-id>/security/ /api/<project-id>/store/ /api/<project-id>/unreal/ Depending on the SDK or client, requests to these endpoints are performed with compressed content-encoding or chunked transfer-encoding. Depending on the infrastructure in front of Relay, please check the following HTTP headers are set correctly: Host : to the public host name of this Relay X-Forwarded-For : to the client IP address X-Sentry-Auth : to the value provided by the client Proxies often set a default maximum body size for requests. Especially native crash reports and attachments can exceed these limits. We recommend to configure a maximum client body size of  100MB . Internally, Relay makes requests to the configured upstream to forward data and retrieve project configuration. We  highly recommend against  constraining these requests. At present, Relay makes requests to the following endpoints for basic operation: All of the above endpoints /api/0/relays/projectconfigs/ /api/0/relays/publickeys/ /api/0/relays/register/challenge/ /api/0/relays/register/response/","title":"Operating Guidelines","description":"Learn about our guidelines for operation when self-hosting external Relays.","draft":null,"noindex":null,"notoc":null,"sidebar_order":5,"redirect_from":["/meta/relay/best-practices/","/product/relay/best-practices/"],"keywords":null,"id":"12f51cc6-d76a-5b9d-b549-aad4259a3a72","legacy":false}},"staticQueryHashes":["1218203755","1222113826","1222113826","1766336459","2158593473","2764967025","3345802723","3818502851","3990806462","4015007367","4192517163","4264099332","518019976"]}