You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2022/04/21 19:17:15 UTC
[GitHub] [trafficcontrol] ocket8888 opened a new pull request, #6769: Document Traffic Monitor configuration files
ocket8888 opened a new pull request, #6769:
URL: https://github.com/apache/trafficcontrol/pull/6769
This PR adds/updates documentation for the configuration files used by Traffic Monitor (typically named `traffic_ops.cfg` and `traffic_monitor.cfg`).
This also fixes a bug in table rendering currently on master since #6569.
<hr/>
## Which Traffic Control components are affected by this PR?
- Documentation
## What is the best way to verify this PR?
Make sure the docs build without errors or warnings, and are accurate, thorough, and clear.
## If this is a bugfix, which Traffic Control versions contained the bug?
- master
## PR submission checklist
- [ ] This PR has tests
- [x] This PR has documentation
- [ ] This PR has a CHANGELOG.md entry
- [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY**
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] rawlinp merged pull request #6769: Document Traffic Monitor configuration files
Posted by GitBox <gi...@apache.org>.
rawlinp merged PR #6769:
URL: https://github.com/apache/trafficcontrol/pull/6769
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] rawlinp commented on a diff in pull request #6769: Document Traffic Monitor configuration files
Posted by GitBox <gi...@apache.org>.
rawlinp commented on code in PR #6769:
URL: https://github.com/apache/trafficcontrol/pull/6769#discussion_r855542562
##########
traffic_monitor/config/config.go:
##########
@@ -97,37 +97,79 @@ func (t *PollingProtocol) UnmarshalJSON(b []byte) error {
return nil
}
-// Config is the configuration for the application. It includes myriad data, such as polling intervals and log locations.
+// Config is the configuration for the application. It includes myriad data,
+// such as polling intervals and log locations.
type Config struct {
- MonitorConfigPollingInterval time.Duration `json:"-"`
- HTTPTimeout time.Duration `json:"-"`
- PeerOptimistic bool `json:"peer_optimistic"`
- PeerOptimisticQuorumMin int `json:"peer_optimistic_quorum_min"`
- DistributedPolling bool `json:"distributed_polling"`
- StatPolling bool `json:"stat_polling"`
- MaxEvents uint64 `json:"max_events"`
- HealthFlushInterval time.Duration `json:"-"`
- StatFlushInterval time.Duration `json:"-"`
- StatBufferInterval time.Duration `json:"-"`
- LogLocationError string `json:"log_location_error"`
- LogLocationWarning string `json:"log_location_warning"`
- LogLocationInfo string `json:"log_location_info"`
- LogLocationDebug string `json:"log_location_debug"`
- LogLocationEvent string `json:"log_location_event"`
- LogLocationAccess string `json:"log_location_access"`
- ServeReadTimeout time.Duration `json:"-"`
- ServeWriteTimeout time.Duration `json:"-"`
- StaticFileDir string `json:"static_file_dir"`
- CRConfigHistoryCount uint64 `json:"crconfig_history_count"`
- TrafficOpsMinRetryInterval time.Duration `json:"-"`
- TrafficOpsMaxRetryInterval time.Duration `json:"-"`
- CRConfigBackupFile string `json:"crconfig_backup_file"`
- TMConfigBackupFile string `json:"tmconfig_backup_file"`
- TrafficOpsDiskRetryMax uint64 `json:"traffic_ops_disk_retry_max"`
- CachePollingProtocol PollingProtocol `json:"cache_polling_protocol"`
- HTTPPollingFormat string `json:"http_polling_format"`
+ // Sets the Internet Protocol version used for polling cache servers.
+ CachePollingProtocol PollingProtocol `json:"cache_polling_protocol"`
+ // A path to a file where CDN Snapshot backups are written.
+ CRConfigBackupFile string `json:"crconfig_backup_file"`
+ // The number of historical CDN Snapshots to store.
+ CRConfigHistoryCount uint64 `json:"crconfig_history_count"`
+ // Controls whether Distributed Polling is enabled.
+ DistributedPolling bool `json:"distributed_polling"`
+ // Defines an interval on which Traffic Monitor will flush its collected
+ // health data such that it is made available through the API.
+ HealthFlushInterval time.Duration `json:"-"`
+ // A MIME-Type that will be sent in the Accept HTTP header in requests to
+ // cache servers for health and stats data.
+ HTTPPollingFormat string `json:"http_polling_format"`
+ // Sets the timeout duration for all HTTP operations - peer-polling and
+ // health data polling.
+ HTTPTimeout time.Duration `json:"-"`
+ // A "lib/go-log"-compliant string defining the logging of Access-level
+ // logs.
+ LogLocationAccess string `json:"log_location_access"`
+ // A "lib/go-log"-compliant string defining the logging of Debug-level logs.
+ LogLocationDebug string `json:"log_location_debug"`
+ // A "lib/go-log"-compliant string defining the logging of Error-level logs.
+ LogLocationError string `json:"log_location_error"`
+ // A "lib/go-log"-compliant string defining the logging of Event-level logs.
+ LogLocationEvent string `json:"log_location_event"`
+ // A "lib/go-log"-compliant string defining the logging of Info-level logs.
+ LogLocationInfo string `json:"log_location_info"`
+ // A "lib/go-log"-compliant string defining the logging of Warning-level
+ // logs.
+ LogLocationWarning string `json:"log_location_warning"`
+ // The maximum number of events to keep in TM's buffer to be served via its
+ // API.
+ MaxEvents uint64 `json:"max_events"`
+ // The interval on which to poll for this TM's CDN's "monitoring config".
+ MonitorConfigPollingInterval time.Duration `json:"-"`
+ // This appears to do nothing.
+ //
+ // Deprecated: This serves no purpose and will be removed in the future.
+ PeerOptimistic bool `json:"peer_optimistic"`
Review Comment:
Sure, let's just remove it then. I don't mind reviewing that
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] ocket8888 commented on a diff in pull request #6769: Document Traffic Monitor configuration files
Posted by GitBox <gi...@apache.org>.
ocket8888 commented on code in PR #6769:
URL: https://github.com/apache/trafficcontrol/pull/6769#discussion_r855538347
##########
traffic_monitor/config/config.go:
##########
@@ -149,33 +191,33 @@ func GetAccessLogWriter(cfg Config) (io.WriteCloser, error) {
// DefaultConfig is the default configuration for the application, if no configuration file is given, or if a given config setting doesn't exist in the config file.
var DefaultConfig = Config{
- MonitorConfigPollingInterval: 5 * time.Second,
- HTTPTimeout: 2 * time.Second,
- PeerOptimistic: true,
- PeerOptimisticQuorumMin: 0,
- StatPolling: true,
- MaxEvents: 200,
+ CachePollingProtocol: Both,
+ CRConfigBackupFile: CRConfigBackupFile,
+ CRConfigHistoryCount: 20000,
Review Comment:
¯\\\_(ツ)\_/¯
I didn't change any of these values, just sorted the lines alphabetically. I can change the defaults if these don't make sense, though.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] rawlinp commented on a diff in pull request #6769: Document Traffic Monitor configuration files
Posted by GitBox <gi...@apache.org>.
rawlinp commented on code in PR #6769:
URL: https://github.com/apache/trafficcontrol/pull/6769#discussion_r855541783
##########
traffic_monitor/config/config.go:
##########
@@ -149,33 +191,33 @@ func GetAccessLogWriter(cfg Config) (io.WriteCloser, error) {
// DefaultConfig is the default configuration for the application, if no configuration file is given, or if a given config setting doesn't exist in the config file.
var DefaultConfig = Config{
- MonitorConfigPollingInterval: 5 * time.Second,
- HTTPTimeout: 2 * time.Second,
- PeerOptimistic: true,
- PeerOptimisticQuorumMin: 0,
- StatPolling: true,
- MaxEvents: 200,
+ CachePollingProtocol: Both,
+ CRConfigBackupFile: CRConfigBackupFile,
+ CRConfigHistoryCount: 20000,
Review Comment:
Might as well while we're in here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] rawlinp commented on a diff in pull request #6769: Document Traffic Monitor configuration files
Posted by GitBox <gi...@apache.org>.
rawlinp commented on code in PR #6769:
URL: https://github.com/apache/trafficcontrol/pull/6769#discussion_r856530602
##########
docs/source/admin/traffic_monitor.rst:
##########
@@ -48,17 +48,85 @@ These are the recommended hardware specifications for a production deployment of
Configuring Traffic Monitor
===========================
-Configuration Overview
-----------------------
-Traffic Monitor is configured via two JSON configuration files, :file:`traffic_ops.cfg` and :file:`traffic_monitor.cfg`, by default located in the ``conf`` directory in the install location. :file:`traffic_ops.cfg` contains Traffic Ops connection information. Specify the URL, username, and password for the instance of Traffic Ops of which this Traffic Monitor is a member. :file:`traffic_monitor.cfg` contains log file locations, as well as detailed application configuration variables such as processing flush times, initial poll intervals, and the polling protocols. Once started with the correct configuration, Traffic Monitor downloads its configuration from Traffic Ops and begins polling :term:`cache server` s. Once every :term:`cache server` has been polled, :ref:`health-proto` state is available via RESTful JSON endpoints and a web browser UI.
+Configuration Files
+-------------------
+Traffic Monitor is configured via two JSON configuration files, :file:`traffic_ops.cfg` and :file:`traffic_monitor.cfg`, by default located in the ``conf`` directory in the install location.
+
+traffic_ops.cfg
+"""""""""""""""
+:file:`traffic_ops.cfg` contains Traffic Ops connection information. Specify the URL, username, and password for the instance of Traffic Ops of which this Traffic Monitor is a member. However, this *also* sets some settings relating to the Traffic Monitor API server.
+
+:``cdnName``: The name of the CDN to which this Traffic Monitor belongs. Used to fetch configuration and to determine which :term:`cache servers` to monitor.
+:``certFile``: The path to an SSL certificate file that corresponds to ``keyFile`` which will be used for Traffic Monitor's HTTPS API server.
+:``httpListener``: Sets the address on which Traffic Monitor will listen for HTTP requests.
+:``httpsListener``: Sets the address on which Traffic Monitor will listen for HTTPS requests. If not provided, ``null``, or the empty string, Traffic Monitor will only serve HTTP, and ``keyFile`` and ``certFile`` are not used. If this is provided, the ``httpListener`` address will be used only to redirect clients to use HTTPS.
Review Comment:
I think for these `*Listener` options, it's actually more like an `address:port` combo, where the address is optional. If unspecified, TM will listen on all addresses.
##########
docs/source/admin/traffic_monitor.rst:
##########
@@ -48,17 +48,85 @@ These are the recommended hardware specifications for a production deployment of
Configuring Traffic Monitor
===========================
-Configuration Overview
-----------------------
-Traffic Monitor is configured via two JSON configuration files, :file:`traffic_ops.cfg` and :file:`traffic_monitor.cfg`, by default located in the ``conf`` directory in the install location. :file:`traffic_ops.cfg` contains Traffic Ops connection information. Specify the URL, username, and password for the instance of Traffic Ops of which this Traffic Monitor is a member. :file:`traffic_monitor.cfg` contains log file locations, as well as detailed application configuration variables such as processing flush times, initial poll intervals, and the polling protocols. Once started with the correct configuration, Traffic Monitor downloads its configuration from Traffic Ops and begins polling :term:`cache server` s. Once every :term:`cache server` has been polled, :ref:`health-proto` state is available via RESTful JSON endpoints and a web browser UI.
+Configuration Files
+-------------------
+Traffic Monitor is configured via two JSON configuration files, :file:`traffic_ops.cfg` and :file:`traffic_monitor.cfg`, by default located in the ``conf`` directory in the install location.
+
+traffic_ops.cfg
+"""""""""""""""
+:file:`traffic_ops.cfg` contains Traffic Ops connection information. Specify the URL, username, and password for the instance of Traffic Ops of which this Traffic Monitor is a member. However, this *also* sets some settings relating to the Traffic Monitor API server.
+
+:``cdnName``: The name of the CDN to which this Traffic Monitor belongs. Used to fetch configuration and to determine which :term:`cache servers` to monitor.
+:``certFile``: The path to an SSL certificate file that corresponds to ``keyFile`` which will be used for Traffic Monitor's HTTPS API server.
+:``httpListener``: Sets the address on which Traffic Monitor will listen for HTTP requests.
+:``httpsListener``: Sets the address on which Traffic Monitor will listen for HTTPS requests. If not provided, ``null``, or the empty string, Traffic Monitor will only serve HTTP, and ``keyFile`` and ``certFile`` are not used. If this is provided, the ``httpListener`` address will be used only to redirect clients to use HTTPS.
+:``insecure``: A boolean that controls whether to validate the HTTPS certificate prevented by the Traffic Ops server.
+:``keyFile``: The path to an SSL key file that corresponds to ``certFile`` which will be used for Traffic Monitor's HTTPS API server.
+:``password``: The password of the user identified by ``username``.
+:``url``: The URL at which Traffic Ops may be reached e.g. ``"https://trafficops.infra.ciab.test"``.
+:``username``: The username of the user as whom to authenticate with Traffic Ops.
+:``usingDummyTO``: A boolean with no real effect. This value is used internally within the runtime of Traffic Monitor, and should never be set manually in its configuration file.
+
+ .. deprecated:: ATCv7
+ The dependency on this field being valid will be removed in the future. It already has no effect.
+
+
+traffic_monitor.cfg
+"""""""""""""""""""
+:file:`traffic_monitor.cfg` contains log file locations, as well as detailed application configuration variables such as processing flush times, initial poll intervals, and the polling protocols. Once started with the correct configuration, Traffic Monitor downloads its configuration from Traffic Ops which will override the options in this file and begins polling :term:`cache server` s. Once every :term:`cache server` has been polled, :ref:`health-proto` state is available via RESTful JSON endpoints and a web browser UI.
Review Comment:
> Traffic Monitor downloads its configuration from Traffic Ops which will override the options in this file
I don't believe this is actually true of all fields, only a few of them. For instance, `distributed_polling`, `stat_polling`, and `log_location*` definitely aren't overridden.
##########
docs/source/admin/traffic_monitor.rst:
##########
@@ -48,17 +48,85 @@ These are the recommended hardware specifications for a production deployment of
Configuring Traffic Monitor
===========================
-Configuration Overview
-----------------------
-Traffic Monitor is configured via two JSON configuration files, :file:`traffic_ops.cfg` and :file:`traffic_monitor.cfg`, by default located in the ``conf`` directory in the install location. :file:`traffic_ops.cfg` contains Traffic Ops connection information. Specify the URL, username, and password for the instance of Traffic Ops of which this Traffic Monitor is a member. :file:`traffic_monitor.cfg` contains log file locations, as well as detailed application configuration variables such as processing flush times, initial poll intervals, and the polling protocols. Once started with the correct configuration, Traffic Monitor downloads its configuration from Traffic Ops and begins polling :term:`cache server` s. Once every :term:`cache server` has been polled, :ref:`health-proto` state is available via RESTful JSON endpoints and a web browser UI.
+Configuration Files
+-------------------
+Traffic Monitor is configured via two JSON configuration files, :file:`traffic_ops.cfg` and :file:`traffic_monitor.cfg`, by default located in the ``conf`` directory in the install location.
+
+traffic_ops.cfg
+"""""""""""""""
+:file:`traffic_ops.cfg` contains Traffic Ops connection information. Specify the URL, username, and password for the instance of Traffic Ops of which this Traffic Monitor is a member. However, this *also* sets some settings relating to the Traffic Monitor API server.
+
+:``cdnName``: The name of the CDN to which this Traffic Monitor belongs. Used to fetch configuration and to determine which :term:`cache servers` to monitor.
+:``certFile``: The path to an SSL certificate file that corresponds to ``keyFile`` which will be used for Traffic Monitor's HTTPS API server.
+:``httpListener``: Sets the address on which Traffic Monitor will listen for HTTP requests.
+:``httpsListener``: Sets the address on which Traffic Monitor will listen for HTTPS requests. If not provided, ``null``, or the empty string, Traffic Monitor will only serve HTTP, and ``keyFile`` and ``certFile`` are not used. If this is provided, the ``httpListener`` address will be used only to redirect clients to use HTTPS.
+:``insecure``: A boolean that controls whether to validate the HTTPS certificate prevented by the Traffic Ops server.
Review Comment:
~prevented~ presented
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] rawlinp commented on a diff in pull request #6769: Document Traffic Monitor configuration files
Posted by GitBox <gi...@apache.org>.
rawlinp commented on code in PR #6769:
URL: https://github.com/apache/trafficcontrol/pull/6769#discussion_r856552979
##########
docs/source/admin/traffic_monitor.rst:
##########
@@ -48,17 +48,85 @@ These are the recommended hardware specifications for a production deployment of
Configuring Traffic Monitor
===========================
-Configuration Overview
-----------------------
-Traffic Monitor is configured via two JSON configuration files, :file:`traffic_ops.cfg` and :file:`traffic_monitor.cfg`, by default located in the ``conf`` directory in the install location. :file:`traffic_ops.cfg` contains Traffic Ops connection information. Specify the URL, username, and password for the instance of Traffic Ops of which this Traffic Monitor is a member. :file:`traffic_monitor.cfg` contains log file locations, as well as detailed application configuration variables such as processing flush times, initial poll intervals, and the polling protocols. Once started with the correct configuration, Traffic Monitor downloads its configuration from Traffic Ops and begins polling :term:`cache server` s. Once every :term:`cache server` has been polled, :ref:`health-proto` state is available via RESTful JSON endpoints and a web browser UI.
+Configuration Files
+-------------------
+Traffic Monitor is configured via two JSON configuration files, :file:`traffic_ops.cfg` and :file:`traffic_monitor.cfg`, by default located in the ``conf`` directory in the install location.
+
+traffic_ops.cfg
+"""""""""""""""
+:file:`traffic_ops.cfg` contains Traffic Ops connection information. Specify the URL, username, and password for the instance of Traffic Ops of which this Traffic Monitor is a member. However, this *also* sets some settings relating to the Traffic Monitor API server.
+
+:``cdnName``: The name of the CDN to which this Traffic Monitor belongs. Used to fetch configuration and to determine which :term:`cache servers` to monitor.
+:``certFile``: The path to an SSL certificate file that corresponds to ``keyFile`` which will be used for Traffic Monitor's HTTPS API server.
+:``httpListener``: Sets the address on which Traffic Monitor will listen for HTTP requests.
+:``httpsListener``: Sets the address on which Traffic Monitor will listen for HTTPS requests. If not provided, ``null``, or the empty string, Traffic Monitor will only serve HTTP, and ``keyFile`` and ``certFile`` are not used. If this is provided, the ``httpListener`` address will be used only to redirect clients to use HTTPS.
+:``insecure``: A boolean that controls whether to validate the HTTPS certificate prevented by the Traffic Ops server.
+:``keyFile``: The path to an SSL key file that corresponds to ``certFile`` which will be used for Traffic Monitor's HTTPS API server.
+:``password``: The password of the user identified by ``username``.
+:``url``: The URL at which Traffic Ops may be reached e.g. ``"https://trafficops.infra.ciab.test"``.
+:``username``: The username of the user as whom to authenticate with Traffic Ops.
+:``usingDummyTO``: A boolean with no real effect. This value is used internally within the runtime of Traffic Monitor, and should never be set manually in its configuration file.
+
+ .. deprecated:: ATCv7
+ The dependency on this field being valid will be removed in the future. It already has no effect.
+
+
+traffic_monitor.cfg
+"""""""""""""""""""
+:file:`traffic_monitor.cfg` contains log file locations, as well as detailed application configuration variables such as processing flush times, initial poll intervals, and the polling protocols. Once started with the correct configuration, Traffic Monitor downloads its configuration from Traffic Ops which will override the options in this file and begins polling :term:`cache server` s. Once every :term:`cache server` has been polled, :ref:`health-proto` state is available via RESTful JSON endpoints and a web browser UI.
Review Comment:
Oh ok, yeah, if there are corresponding TM profile params, those will override options in the config file, but not the other way around. Ideally, we should notate the corresponding TM profile params which would override the config file options. I'm pretty sure that includes at least these ones:
```
tm.polling.interval
health.polling.interval
peers.polling.interval
heartbeat.polling.interval
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] ocket8888 commented on a diff in pull request #6769: Document Traffic Monitor configuration files
Posted by GitBox <gi...@apache.org>.
ocket8888 commented on code in PR #6769:
URL: https://github.com/apache/trafficcontrol/pull/6769#discussion_r855539665
##########
traffic_monitor/config/config.go:
##########
@@ -97,37 +97,79 @@ func (t *PollingProtocol) UnmarshalJSON(b []byte) error {
return nil
}
-// Config is the configuration for the application. It includes myriad data, such as polling intervals and log locations.
+// Config is the configuration for the application. It includes myriad data,
+// such as polling intervals and log locations.
type Config struct {
- MonitorConfigPollingInterval time.Duration `json:"-"`
- HTTPTimeout time.Duration `json:"-"`
- PeerOptimistic bool `json:"peer_optimistic"`
- PeerOptimisticQuorumMin int `json:"peer_optimistic_quorum_min"`
- DistributedPolling bool `json:"distributed_polling"`
- StatPolling bool `json:"stat_polling"`
- MaxEvents uint64 `json:"max_events"`
- HealthFlushInterval time.Duration `json:"-"`
- StatFlushInterval time.Duration `json:"-"`
- StatBufferInterval time.Duration `json:"-"`
- LogLocationError string `json:"log_location_error"`
- LogLocationWarning string `json:"log_location_warning"`
- LogLocationInfo string `json:"log_location_info"`
- LogLocationDebug string `json:"log_location_debug"`
- LogLocationEvent string `json:"log_location_event"`
- LogLocationAccess string `json:"log_location_access"`
- ServeReadTimeout time.Duration `json:"-"`
- ServeWriteTimeout time.Duration `json:"-"`
- StaticFileDir string `json:"static_file_dir"`
- CRConfigHistoryCount uint64 `json:"crconfig_history_count"`
- TrafficOpsMinRetryInterval time.Duration `json:"-"`
- TrafficOpsMaxRetryInterval time.Duration `json:"-"`
- CRConfigBackupFile string `json:"crconfig_backup_file"`
- TMConfigBackupFile string `json:"tmconfig_backup_file"`
- TrafficOpsDiskRetryMax uint64 `json:"traffic_ops_disk_retry_max"`
- CachePollingProtocol PollingProtocol `json:"cache_polling_protocol"`
- HTTPPollingFormat string `json:"http_polling_format"`
+ // Sets the Internet Protocol version used for polling cache servers.
+ CachePollingProtocol PollingProtocol `json:"cache_polling_protocol"`
+ // A path to a file where CDN Snapshot backups are written.
+ CRConfigBackupFile string `json:"crconfig_backup_file"`
+ // The number of historical CDN Snapshots to store.
+ CRConfigHistoryCount uint64 `json:"crconfig_history_count"`
+ // Controls whether Distributed Polling is enabled.
+ DistributedPolling bool `json:"distributed_polling"`
+ // Defines an interval on which Traffic Monitor will flush its collected
+ // health data such that it is made available through the API.
+ HealthFlushInterval time.Duration `json:"-"`
+ // A MIME-Type that will be sent in the Accept HTTP header in requests to
+ // cache servers for health and stats data.
+ HTTPPollingFormat string `json:"http_polling_format"`
+ // Sets the timeout duration for all HTTP operations - peer-polling and
+ // health data polling.
+ HTTPTimeout time.Duration `json:"-"`
+ // A "lib/go-log"-compliant string defining the logging of Access-level
+ // logs.
+ LogLocationAccess string `json:"log_location_access"`
+ // A "lib/go-log"-compliant string defining the logging of Debug-level logs.
+ LogLocationDebug string `json:"log_location_debug"`
+ // A "lib/go-log"-compliant string defining the logging of Error-level logs.
+ LogLocationError string `json:"log_location_error"`
+ // A "lib/go-log"-compliant string defining the logging of Event-level logs.
+ LogLocationEvent string `json:"log_location_event"`
+ // A "lib/go-log"-compliant string defining the logging of Info-level logs.
+ LogLocationInfo string `json:"log_location_info"`
+ // A "lib/go-log"-compliant string defining the logging of Warning-level
+ // logs.
+ LogLocationWarning string `json:"log_location_warning"`
+ // The maximum number of events to keep in TM's buffer to be served via its
+ // API.
+ MaxEvents uint64 `json:"max_events"`
+ // The interval on which to poll for this TM's CDN's "monitoring config".
+ MonitorConfigPollingInterval time.Duration `json:"-"`
+ // This appears to do nothing.
+ //
+ // Deprecated: This serves no purpose and will be removed in the future.
+ PeerOptimistic bool `json:"peer_optimistic"`
Review Comment:
That's true. I don't mind taking it out at all, but the reason I deprecated it instead was just so that there were no changes to the logic/behavior of Traffic Monitor whatsoever. All I did was sort lines (which I guess technically affects structure packing) and add comments. I'll change things if you want, I just want to be clear that that's what you're asking.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] ocket8888 commented on a diff in pull request #6769: Document Traffic Monitor configuration files
Posted by GitBox <gi...@apache.org>.
ocket8888 commented on code in PR #6769:
URL: https://github.com/apache/trafficcontrol/pull/6769#discussion_r856549486
##########
docs/source/admin/traffic_monitor.rst:
##########
@@ -48,17 +48,85 @@ These are the recommended hardware specifications for a production deployment of
Configuring Traffic Monitor
===========================
-Configuration Overview
-----------------------
-Traffic Monitor is configured via two JSON configuration files, :file:`traffic_ops.cfg` and :file:`traffic_monitor.cfg`, by default located in the ``conf`` directory in the install location. :file:`traffic_ops.cfg` contains Traffic Ops connection information. Specify the URL, username, and password for the instance of Traffic Ops of which this Traffic Monitor is a member. :file:`traffic_monitor.cfg` contains log file locations, as well as detailed application configuration variables such as processing flush times, initial poll intervals, and the polling protocols. Once started with the correct configuration, Traffic Monitor downloads its configuration from Traffic Ops and begins polling :term:`cache server` s. Once every :term:`cache server` has been polled, :ref:`health-proto` state is available via RESTful JSON endpoints and a web browser UI.
+Configuration Files
+-------------------
+Traffic Monitor is configured via two JSON configuration files, :file:`traffic_ops.cfg` and :file:`traffic_monitor.cfg`, by default located in the ``conf`` directory in the install location.
+
+traffic_ops.cfg
+"""""""""""""""
+:file:`traffic_ops.cfg` contains Traffic Ops connection information. Specify the URL, username, and password for the instance of Traffic Ops of which this Traffic Monitor is a member. However, this *also* sets some settings relating to the Traffic Monitor API server.
+
+:``cdnName``: The name of the CDN to which this Traffic Monitor belongs. Used to fetch configuration and to determine which :term:`cache servers` to monitor.
+:``certFile``: The path to an SSL certificate file that corresponds to ``keyFile`` which will be used for Traffic Monitor's HTTPS API server.
+:``httpListener``: Sets the address on which Traffic Monitor will listen for HTTP requests.
+:``httpsListener``: Sets the address on which Traffic Monitor will listen for HTTPS requests. If not provided, ``null``, or the empty string, Traffic Monitor will only serve HTTP, and ``keyFile`` and ``certFile`` are not used. If this is provided, the ``httpListener`` address will be used only to redirect clients to use HTTPS.
+:``insecure``: A boolean that controls whether to validate the HTTPS certificate prevented by the Traffic Ops server.
+:``keyFile``: The path to an SSL key file that corresponds to ``certFile`` which will be used for Traffic Monitor's HTTPS API server.
+:``password``: The password of the user identified by ``username``.
+:``url``: The URL at which Traffic Ops may be reached e.g. ``"https://trafficops.infra.ciab.test"``.
+:``username``: The username of the user as whom to authenticate with Traffic Ops.
+:``usingDummyTO``: A boolean with no real effect. This value is used internally within the runtime of Traffic Monitor, and should never be set manually in its configuration file.
+
+ .. deprecated:: ATCv7
+ The dependency on this field being valid will be removed in the future. It already has no effect.
+
+
+traffic_monitor.cfg
+"""""""""""""""""""
+:file:`traffic_monitor.cfg` contains log file locations, as well as detailed application configuration variables such as processing flush times, initial poll intervals, and the polling protocols. Once started with the correct configuration, Traffic Monitor downloads its configuration from Traffic Ops which will override the options in this file and begins polling :term:`cache server` s. Once every :term:`cache server` has been polled, :ref:`health-proto` state is available via RESTful JSON endpoints and a web browser UI.
Review Comment:
I only meant that the configuration present in Traffic Ops would override the file's configuration - so if there's no way to configure something in Traffic Ops it couldn't be overridden.
I can try to make that more clear, but is that base assumption true? Or are there things that can be configured in Traffic Ops that would be overridden by the TM config file?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] rawlinp commented on a diff in pull request #6769: Document Traffic Monitor configuration files
Posted by GitBox <gi...@apache.org>.
rawlinp commented on code in PR #6769:
URL: https://github.com/apache/trafficcontrol/pull/6769#discussion_r855534203
##########
traffic_monitor/config/config.go:
##########
@@ -149,33 +191,33 @@ func GetAccessLogWriter(cfg Config) (io.WriteCloser, error) {
// DefaultConfig is the default configuration for the application, if no configuration file is given, or if a given config setting doesn't exist in the config file.
var DefaultConfig = Config{
- MonitorConfigPollingInterval: 5 * time.Second,
- HTTPTimeout: 2 * time.Second,
- PeerOptimistic: true,
- PeerOptimisticQuorumMin: 0,
- StatPolling: true,
- MaxEvents: 200,
+ CachePollingProtocol: Both,
+ CRConfigBackupFile: CRConfigBackupFile,
+ CRConfigHistoryCount: 20000,
Review Comment:
we should make this like...100? I can't imagine needing more than like 10 in reality, but 20,000 seems ridiculous
##########
traffic_monitor/config/config.go:
##########
@@ -97,37 +97,79 @@ func (t *PollingProtocol) UnmarshalJSON(b []byte) error {
return nil
}
-// Config is the configuration for the application. It includes myriad data, such as polling intervals and log locations.
+// Config is the configuration for the application. It includes myriad data,
+// such as polling intervals and log locations.
type Config struct {
- MonitorConfigPollingInterval time.Duration `json:"-"`
- HTTPTimeout time.Duration `json:"-"`
- PeerOptimistic bool `json:"peer_optimistic"`
- PeerOptimisticQuorumMin int `json:"peer_optimistic_quorum_min"`
- DistributedPolling bool `json:"distributed_polling"`
- StatPolling bool `json:"stat_polling"`
- MaxEvents uint64 `json:"max_events"`
- HealthFlushInterval time.Duration `json:"-"`
- StatFlushInterval time.Duration `json:"-"`
- StatBufferInterval time.Duration `json:"-"`
- LogLocationError string `json:"log_location_error"`
- LogLocationWarning string `json:"log_location_warning"`
- LogLocationInfo string `json:"log_location_info"`
- LogLocationDebug string `json:"log_location_debug"`
- LogLocationEvent string `json:"log_location_event"`
- LogLocationAccess string `json:"log_location_access"`
- ServeReadTimeout time.Duration `json:"-"`
- ServeWriteTimeout time.Duration `json:"-"`
- StaticFileDir string `json:"static_file_dir"`
- CRConfigHistoryCount uint64 `json:"crconfig_history_count"`
- TrafficOpsMinRetryInterval time.Duration `json:"-"`
- TrafficOpsMaxRetryInterval time.Duration `json:"-"`
- CRConfigBackupFile string `json:"crconfig_backup_file"`
- TMConfigBackupFile string `json:"tmconfig_backup_file"`
- TrafficOpsDiskRetryMax uint64 `json:"traffic_ops_disk_retry_max"`
- CachePollingProtocol PollingProtocol `json:"cache_polling_protocol"`
- HTTPPollingFormat string `json:"http_polling_format"`
+ // Sets the Internet Protocol version used for polling cache servers.
+ CachePollingProtocol PollingProtocol `json:"cache_polling_protocol"`
+ // A path to a file where CDN Snapshot backups are written.
+ CRConfigBackupFile string `json:"crconfig_backup_file"`
+ // The number of historical CDN Snapshots to store.
+ CRConfigHistoryCount uint64 `json:"crconfig_history_count"`
+ // Controls whether Distributed Polling is enabled.
+ DistributedPolling bool `json:"distributed_polling"`
+ // Defines an interval on which Traffic Monitor will flush its collected
+ // health data such that it is made available through the API.
+ HealthFlushInterval time.Duration `json:"-"`
+ // A MIME-Type that will be sent in the Accept HTTP header in requests to
+ // cache servers for health and stats data.
+ HTTPPollingFormat string `json:"http_polling_format"`
+ // Sets the timeout duration for all HTTP operations - peer-polling and
+ // health data polling.
+ HTTPTimeout time.Duration `json:"-"`
+ // A "lib/go-log"-compliant string defining the logging of Access-level
+ // logs.
+ LogLocationAccess string `json:"log_location_access"`
+ // A "lib/go-log"-compliant string defining the logging of Debug-level logs.
+ LogLocationDebug string `json:"log_location_debug"`
+ // A "lib/go-log"-compliant string defining the logging of Error-level logs.
+ LogLocationError string `json:"log_location_error"`
+ // A "lib/go-log"-compliant string defining the logging of Event-level logs.
+ LogLocationEvent string `json:"log_location_event"`
+ // A "lib/go-log"-compliant string defining the logging of Info-level logs.
+ LogLocationInfo string `json:"log_location_info"`
+ // A "lib/go-log"-compliant string defining the logging of Warning-level
+ // logs.
+ LogLocationWarning string `json:"log_location_warning"`
+ // The maximum number of events to keep in TM's buffer to be served via its
+ // API.
+ MaxEvents uint64 `json:"max_events"`
+ // The interval on which to poll for this TM's CDN's "monitoring config".
+ MonitorConfigPollingInterval time.Duration `json:"-"`
+ // This appears to do nothing.
+ //
+ // Deprecated: This serves no purpose and will be removed in the future.
+ PeerOptimistic bool `json:"peer_optimistic"`
Review Comment:
We should just remove it, no need to deprecate first. Existing configs that still add it won't be broken, it would just remain unused (as it already is).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org